#include <iostream>
#include <cstdio>
#include <vector>

using namespace std;


int main()
{
    int n;
    cin >> n;
    vector <int> am(n + 1, 0);
    vector <int> ans(n);
    ans[0] = 1;
    am[1] = 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;
            if (am[m] + k == am[i] + 1)
                r = m;
            else
                l = m;
        }
        if (r == 0)
            ans[i] = ++cnt, am[i + 1] = am[i] + 1;
        else
            ans[i] = ans[r - 1], am[i + 1] = am[i];
    }
    cout << "Ready!" << endl << cnt << endl;
    for (int i = 0; i < n; ++i)
        cout << ans[i] << ' ';
}
