#include <bits/stdc++.h>
using namespace std;


int main()
{
    int n;
    cin >> n;
    vector<int> ans(n + 1, 1);
    int k = 1;
    for (int i = 2; i <= n; ++i)
    {
        set<int> used;
        int p;
        int j = i - 1;
        do
        {
            used.insert(ans[j]);
            cout << "? " << j << " " << i << endl;
            cout.flush();
            cin >> p;
            --j;
            //cout << used.size() << endl;
        } while ((p != used.size()) && (j != 0));
        if (p != used.size())
        {
            ++k;
            ans[i] = k;
        }
        else
        {
            ans[i] = ans[j + 1];
        }
        //cout << " " << ans[i] << endl;
    }
    //int k;
    //cout << "? " << 1 << " " << n << endl;
    //cout.flush();
    //cin >> k;
    cout << "Ready!" << endl;
    cout.flush();
    cout << k << endl;
    cout.flush();
    for (int i = 1; i <= n; ++i)
    {
        cout << ans[i] << " ";
    }
    cout << endl;
    cout.flush();
    return 0;
}
