#include <iostream>
#include <fstream>
#include <set>
#include <algorithm>
#include <stack>
#include <iomanip>
#include <vector>

using namespace std;
int n, ans[3002], k = 1, d[3000][3000];

bool f(int l, int r){
    int t;
    cout << '?' << ' ' << l << ' ' << r << endl;
    fflush(stdout);
    cin >> t;
    return (d[l][r - 1] == t);

}

int main()
{
    cin >> n;
    ans[1] = 1;
    k = 1;
    for (int i = 2; i <= n; i++){
        cout << '?' << ' ' << 1 << ' ' << i << endl;
        fflush(stdout);
        int t;
        cin >> t;
        if (t > k){
            k++;
            for (int j = 1; j <= i; j++)
                d[j][i] = d[j][i - 1] + 1;
            ans[i] = k;
            continue;
        }
        d[1][i] = k;
        int l = 1, r = i + 1;
        while (l + 1 < r){
            int m = (l + r) / 2;
            if (f(m, i))
                l = m;
            else
                r = m;
        }
        int j = l;
        ans[i] = ans[j];
        for (int l = 1; l <= j; l++)
            d[l][i] = d[l][i - 1];
        for (int l = j + 1; l <= i; l++)
            d[l][i] = d[l][i - 1] + 1;
    }
    cout << "Ready!" << endl << k << endl;
    fflush(stdout);
    for (int i = 1; i <= n; i++)
        cout << ans[i] << ' ';
    return 0;
}
