#include <bits/stdc++.h>

using namespace std;

const int MAX_N = 3000, MAX_K = MAX_N;
int n, k = 1, a[MAX_N + 1], inva[MAX_K + 1], dif[MAX_N + 1][MAX_N + 1];

recalcDif(int r) {
    bool isUsed[MAX_K + 1];
    for (int i = 1; i <= k; i++) {
        isUsed[i] = false;
    }
    dif[r][r] = 1;
    isUsed[a[r]] = true;
    for (int i = r - 1; r > 0; r--) {
        dif[i][r] = dif[i + 1][r];
        if (!isUsed[a[i]]) {
            dif[i][r]++;
        }
        isUsed[a[i]] = true;
    }
}

int get(int i, int j) {
    int p;
    if (i == j) {
        return 1;
    }
    cout << '?' << ' ' << i << ' ' << j << ' ' << endl;
    cout.flush();
    cin >> p;
    return p;
}

int getImm(int i, int j) {
    if (i == j) {
        return 1;
    }
    if (i > j) {
        return 0;
    }
    return dif[i][j];
}

void findai(int i) {
    a[0] = k + 1;
    int l = 1, r = i, m;
    while (r - l > 0) {
        m = (l + r) / 2;
//        cout << l << ' ' << r << endl;
        if (get(m, i) == getImm(m, i - 1)) {
            l = m + 1;
        } else {
            r = m;
        }
    }
//    cout << l << ' ' << r << endl;
    a[i] = a[r - 1];
}

int main() {
    cin >> n;
    a[1] = 1;
    inva[1] = 1;
    k = 1;
    for (int i = 2; i <= n; i++) {
        findai(i);
        k = max(k, a[i]);
        recalcDif(i);
    }
    cout << "Ready!\n";
    cout << k << endl;
    for (int i = 1; i <= n; i++) {
        cout << a[i] << " ";
    }
    cout << endl;
    return 0;
}
