#include <iostream>
#include <cstdio>
#include <string>

using namespace std;

const int maxn = 5e3;

int res[maxn];

bool test (int a, int b)
{
    cout << "? " << a << ' ' << b-1 << endl;
    int r1;
    cin >> r1;
    cout << "? " << a << ' ' << b << endl;
    int r2;
    cin >> r2;
    return r1 == r2;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int n;
    cin >> n;
    int cur = 1, prev = 1;
    res[0] = cur;
    for (int i = 1; i < n; ++i) {
        cout << "? " << 1 << ' ' << i+1 << endl;
        int re;
        cin >> re;
        if (re != prev) {
            res[i] = ++cur;
        } else {
            int l = 0, r = i-1, m;
            while (r-l > 1) {
                m = (l+r)/2;
                if (test(m+1, i+1)) {
                    l = m;
                } else {
                    r = m;
                }
            }
            res[i] = res[l];
        }
        prev = re;
    }
    cout << "Ready!" << endl;
    cout << cur << endl;
    for (int i = 0; i < n; ++i) {
        cout << res[i] << ' ';
    }
    cout << endl;
    return 0;
}
