#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define f first
#define s second
#define mp make_pair
#define pb push_back
#define sqr(x) (x) * (x)

struct dnk
{
    int c, cnt, l;
};

const int LEN = 3100;
vector < dnk > q;
dnk d;
int n, res, use[LEN], res1, k, col;

int main()
{
    //freopen("video.in", "r", stdin);
    //freopen("video.out", "w", stdout);

    cin >> n;
    d.c = 1;
    d.cnt = 1;
    d.l = 0;

    q.pb(d);
    col = 2;


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

        for (int j = 1; j < LEN; j++)
            use[j] = 0;

        cout << "? " << q[q.size() - 1].l + 1 << " " << i + 1 << endl;
        fflush(stdout);

        cin >> res;

        if (res == 1)
            q[q.size() - 1].cnt++;
        else
        {
            use[q[q.size() - 1].c] = 1;
            res1 = -1;

            k = q.size() - 2;
            while (k >= 0 && res != res1)
            {
                if (!use[q[k].c])
                {
                    use[q[k].c] = 1;

                    cout << "? " << q[k].l + 1 << " " << i + 1 << endl;
                    fflush(stdout);

                    cin >> res1;
                    if (res == res1)
                    {
                        d.cnt = 1;
                        d.c = q[k].c;
                        d.l = i;
                        q.pb(d);
                        break;
                    }

                    res = res1;
                }
                k--;
            }
            if (k < 0)
            {
                d.c = col++;
                d.cnt = 1;
                d.l = i;
                q.pb(d);
            }
        }
    }

    cout << "Ready!" << endl;
    fflush(stdout);
    cout << col - 1 << endl;
    fflush(stdout);
    for (int i = 0; i < q.size(); i++)
    {
        for (int j = 0; j < q[i].cnt; j++)
        {
            cout << q[i].c << " ";
            fflush(stdout);
        }
    }

    return 0;
}
