#include <bits/stdc++.h>

using namespace std;

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 = 0; i < n; ++i)
        getans[i][i] = 1;
    for (int i = 1; i < n; ++i)
    {
        int j = i - 1;
        while (j >= 0 && getans[j][i] != getans[j][i - 1])
            --j;
        if (j < 0)
            ans[i] = nw++;
        else
            ans[i] = ans[j];
    }
    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;
}
