#include <bits/stdc++.h>

using namespace std;

void solve()
{
    int n;
    cin >> n;
    vector<int> ans(n, 0);

    int k;
    cout << "? 1 " << n << endl;
    cin >> k;

    vector<char> used(k+2, 0);

    ans[0] = 1;

    int now = 1;
    for (int it = 1; it < n; ++it)
    {
        int a;
        int last_a = 1;
        int j = it;
        while (j--)
            if (!used[ans[j]])
            {
                cout << "? " << j+1 << ' ' << it+1 << endl;
                cin >> a;
                if (a == last_a)
                    break;
                used[ans[j]] = true;
                last_a = a;
            }
        if (j == -1)
            ans[it] = ++now;
        else
            ans[it] = ans[j];
        fill(used.begin(), used.end(), 0);
    }


    cout << "Ready!" << endl;
    cout << k << endl;
    for (int& it : ans)
        cout << it << ' ';

    //assert(now == k);

}

int main()
{
    ios_base::sync_with_stdio(false);

    solve();

    return 0;
}
