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

int q(int L, int R)
{
    int res = 0;
    cout << "? " << L + 1 << ' ' << R + 1 << endl;
    cin >> res;
    return res;
}
vector <int> vec;
int main()
{
    int n;
    cin >> n;
    ans[0] = 1;
    int k = 1;
    vec.push_back(0);
    for (int i = 1; i < n; i++)
    {
        int res = q(0, i);
        if (res > k)
        {
            vec.push_back(i);
            ans[i] = ++k;
        }
        else
        {
            for (int j = vec.size() - 1; j >=0; j--)
            {
                if (q(vec[j], i) == vec.size() - j)
                {
                    ans[i] = ans[vec[j]];
                    break;
                }
            }
            vec[ans[i]] = i;
            /*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;
}
