#include <bits/stdc++.h>
using namespace std;
int ans[3000];

int q(int L, int R)
{
    int res = 0;
    cout << "? " << L + 1 << ' ' << R + 1 << endl;
    cin >> res;
    return res;
}
set <pair<int, int>> vec;
int main()
{
    int n;
    cin >> n;
    ans[0] = 1;
    int k = 1;
    vec.insert({-0, 1});
    for (int i = 1; i < n; i++)
    {
        int res = q(0, i);
        if (res > k)
        {
            vec.insert({-i, k + 1});
            ans[i] = ++k;
        }
        else
        {
            int cnt = 0;
            for (auto pr: vec)
            {
                cnt++;
                if (q(-pr.first, i) == cnt)
                {
                    vec.erase(pr);
                    ans[i] = pr.second;
                    vec.insert({i, pr.second});
                    break;
                }
            }
            /*int L = 0, R = vec.size();
            while (R - L > 1)
            {
                int M = (R + L) / 2;
                int res = q(vec[M], i);
                if (res != vec.size() - M)
                    R = M;
                else
                    L = M;
            }
            ans[i] = L + 1;*/
        }
    }
    cout << "Ready!" << endl;
    cout << k << endl;
    for (int i = 0; i < n; i++)
        cout << ans[i] << ' ';
    cout << endl;
}
