#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <string>
#include <cstring>

using namespace std;

const int MAX_N = 3001;

int n, a[MAX_N], k;

int main()
{
    //#define fname "test"
    //freopen(fname".in", "r", stdin);
    //freopen(fname".out", "w", stdout);
    cin >> n;
    k = 0;
    for (int i = 0; i < n; i++)
    {
        bool f = false;
        if (i)
        {
            int a1, a2;
            cout << "? 1 " << i << endl;
            fflush(stdout);
            cin >> a1;
            cout << "? 1 " << i + 1 << endl;
            cin >> a2;
            if (a1 != a2)
                f = true;
        }
        else
            f = true;
        if (f)
        {
            k++;
            a[i] = k;
        }
        else
        {
            int r = i;
            int l = 0;
            while (r - l > 1)
            {
                int h = (l + r) / 2;
                cout << "1 ? " << i - h + 1 << " " << i + 1 << endl;
                fflush(stdout);
                int a1, a2;
                cin >> a1;
                cout << "1 ? " << i - h + 1 << " " << i << endl;
                fflush(stdout);
                cin >> a2;
                if (a1 != a2)
                    l = h;
                else
                    r = h;
            }
            a[i] = a[i - l - 1];
        }
    }
    cout << "Ready!" << endl;
    fflush(stdout);
    cout << k << endl;
    fflush(stdout);
    for (int i = 0; i < n; i++)
        cout << a[i] << " ";
    return 0;
}
