#include <bits/stdc++.h>

using namespace std;

int main()
{
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);


    int n;
    cin >> n;

    vector< vector<int> > cc(n, vector<int>(n));
    vector<int> ans(n);

    cc[0][0] = 1;
    ans[0] = 1;
    int k = 1;

    int resp;
    int l, r, m;

    for (int i = 1; i < n; i++)
    {
        cc[i][i] = 1;

        cout << "? 1 " << i + 1 << '\n';
        cout.flush();

        cin >> resp;

        if (resp > cc[0][i - 1])
        {
            ans[i] = ++k;

            for (int h = 0; h < i; h++)
                cc[h][i] = cc[h][i - 1] + 1;

            continue;
        }

        l = 0, r = i;

        while (r - l > 1)
        {
            m = (l + r) / 2;

            cout << "? " << m + 1 << ' ' << i + 1 << '\n';
            cout.flush();

            cin >> resp;

            (resp == cc[m][i] ? l : r) = m;
        }

        ans[i] = ans[l];

        for (int h = 0; h <= l; h++)
            cc[h][i] = cc[h][i - 1];

        for (int h = r; h < i; h++)
            cc[h][i] = cc[h][i - 1] + 1;
    }

    cout << "Ready!\n";
    cout << k << '\n';

    for (int el : ans)
        cout << el << ' ';

    return 0;
}
