#include <bits/stdc++.h>

using namespace std;

int getans(int i, int j)
{
    if (i == j)
        return 1;
    cout << "? " << (i + 1) << " " << (j + 1) << endl;
    int ans;
    cin >> ans;
    return ans;
}

void sol(int n)
{
    int nw = 2;
    int ans[n];
    ans[0] = 1;
    //int getans[n][n];
    //for (int i = 0; i < n; ++i)
      //  for (int j = i + 1; j < n; ++j)
        //{
          //  cout << "? " << (i + 1) << " " << (j + 1) << endl;
           // cin >> getans[i][j];
        //}
    for (int i = 1; i < n; ++i)
    {
        int le = -1, r = i;
        while (r - le > 1)
        {
            int mid = (r + le) / 2;
            int ans = getans(mid, i) - getans(mid, i - 1);
            if (!ans)
                le = mid;
            else
                r = mid;
        }
        if (le < 0)
            ans[i] = nw++;
        else
            ans[i] = ans[le];
    }
    cout << "Ready!" << endl << (nw - 1) << endl;
    for (int i = 0; i < n; ++i)
        cout << ans[i] << " ";
    cout << endl;
    exit(0);
}


int main()
{
    //freopen("video.in", "r", stdin);
    //freopen("video.out", "w", stdout);
    int n;
    while (cin >> n)
        sol(n);
    return 0;
}
