#include <iostream>
#include <cstdio>
#include <vector>

using namespace std;

int ask(int l, int r)
{
    cout << '?' << ' ' << l + 1 << ' ' << r + 1 << endl;
    cout.flush();
    int c;
    cin >> c;
    return c;
}

int main()
{
    int n, i, j;
    cin >> n;
    vector<int> a(n);
    vector<int> p(n);
    vector<int> r(n);
    a[0] = 0;
    int cnt = 1;
    for (i = 1; i < n; i++)
    {
        p.assign(n, 0);
        p[a[i - 1]] = 1;
        r[i - 1] = 1;
        for (j = i - 2; j >= 0; j--)
        {
            r[j] = r[j + 1];
            if (p[a[j]] == 0)
                r[j]++;
            p[a[j]] = 1;
        }
        int c = ask(0, i);
        if (c > cnt)
        {
            a[i] = cnt;
            cnt++;
        }
        else
        {
            int l1 = 0, r1 = i, mid;
            while (l1 + 1 < r1)
            {
                mid = (l1 + r1) / 2;
                c = ask(mid, i);
                if (c == r[mid])
                {
                    l1 = mid;
                }
                else
                {
                    r1 = mid;
                }
            }
            a[i] = a[l1];
        }
    }
    cout << "Ready!" << endl;
    cout << cnt << endl;
    for (i = 0; i < n; i++)
    {
        cout << a[i] + 1 << ' ';
    }
    cout.flush();
    return 0;
}
