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

using namespace std;

const int maxn = 5e3;

int res[maxn];
map<pair<int, int>, int> ma;

int ask(int a, int b)
{
    if (ma.count({a, b}) > 0) {
        return ma[{a, b}];
    }
    int re;
    cout << "? " << a << ' ' << b << endl;
    cin >> re;
    ma[{a, b}] = re;
    return re;
}

bool test (int a, int b)
{
    return ask(a, b-1) == ask(a, b);
}

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) {
        int re = ask(1, i+1);
        if (re != prev) {
            res[i] = ++cur;
        } else {
            int q = 0, p = i;
            for (int w = 0; w+1 < i; ++w) {
                if (ma.count({w+1, i}) > 0) {
                    if (ask(w+1, i+1) == ma[{w+1, i}]) {
                        q = w;
                    } else {
                        p = w;
                        break;
                    }
                }
            }
            int l = q, r = p, 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 << prev << endl;
    for (int i = 0; i < n; ++i) {
        cout << res[i] << ' ';
    }
    cout << endl;
    return 0;
}
