#include <iostream>
#include <cstdio>
#include <vector>
#include <set>
using namespace std;


int main()
{
    int n;
    cin >> n;
    vector <int> ans(n);
    ans[0] = 1;
    int cnt = 1;
    for (int i = 1; i < n; ++i)
    {
        int l = -1, r = i;
        while (l + 1 < r)
        {
            int m = (l + r) / 2;
            cout << "? " << m + 1 << ' ' << i + 1 << endl;
            int k;
            cin >> k;
            set <int> ideal;
            for (int j = m; j < i; ++j)
                ideal.insert(ans[j]);
            if (k == ideal.size() + 1)
                r = m;
            else
                l = m;
        }
        if (r == 0)
            ans[i] = ++cnt;
        else
            ans[i] = ans[r - 1];
    }
    cout << "Ready!" << endl << cnt << endl;
    for (int i = 0; i < n; ++i)
        cout << ans[i] << ' ';
}
