#include <bits/stdc++.h>
using namespace std;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n, x, x1, z = 0, k = 0;
    cin >> n;
    vector < int > ans(n);
    vector < int > res(n);
    ans[0] = ++k;
    res[0] = 1;
    for (int i = 1; i < n; i++)
    {
        int j = 0;
        cout << "? " << 1 << ' ' << i + 1 << endl;
        cin >> x;
        res[i] = x;
        if (x != res[i - 1])
        {
            ans[i] = ++k;
        }
        else
        {
            x1 = x;
            while (x == x1 && j + 1 < i)
            {
                j++;
                cout << "? " << j + 1 << ' ' << i << endl;
                cin >> x1;
                cout << "? " << j + 1 << ' ' << i + 1 << endl;
                cin >> x;
            }
            ans[i] = ans[j];
        }
    }
    cout << "Ready!" << endl;
    cout << res[n - 1] << endl;
    for (auto& x : ans)
    {
        cout << x << ' ';
    }
    return 0;
}
