#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int maxn = 1e3 + 10;

int q[maxn], n;

int p[maxn][maxn];

int last[maxn], sz;

int main()
{
    cin >> n;
    q[0] = 0;
    p[0][0] = 1;
    sz = 1;
    for (int i = 0; i < n; i++)
        last[i] = -1;
    for (int i = 1; i < n; i++){
        int l = 0, r = i + 1;
        while (r - l > 1){
            int m = (l + r) / 2;
            cout << "? " << m << ' ' << i + 1 << endl;
            int x;
            cin >> x;
            if (x == p[0][m - 1])
                l = m;
            else
                r = m;
        }
        if (r == 1)
            q[i] = sz, sz++;
        else
            q[i] = q[l - 1];
        p[i][i] = 1;
        for (int j = 0; j < i; j++)
            p[j][i] = p[j][i - 1] + (last[q[i]] < j);
        last[q[i]] = i;
    }
    cout << "Ready" << endl << sz << endl;
    for (int i = 0; i < n; i++)
        cout << q[i] + 1 << ' ';
    cout << endl;
}
