#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <vector>
using namespace std;


vector <int> get(int l, int r)
{
    vector <int> ans;
    if (l == r)
    {
        ans.push_back(1);
        return ans;
    }
    int m = (l + r) / 2;
    vector <int> t1 = get(l, m);
    vector <int> t2 = get(m + 1, r);
    int cc = 0;
    for (int i = 0; i < t1.size(); i++)
        cc = max(cc, t1[i] + 1);
    vector <int> gg(r - l + 1, -1);
    //cout << l << " " << r << endl;
    for (int i = 0; i < r - m; i++)
    {
        //cout << l << " " << r << endl;
        if (gg[t2[i]] != -1)
        {
            t1.push_back(gg[t2[i]]);
        }
        else
        {
            int ll = l;
            int rr;
            int f1, f2;
            cout << "? " << ll + 1 << " " << i + m + 2 << endl;
            cout.flush();
            fflush(stdout);
            cin >> f1;
            if (f1 == cc)
            {
                t1.push_back(cc);
                gg[t2[i]] = cc;
                cc++;
            }
            else
            {
                ll = l;
                rr = m + 1;
                while (rr - ll > 1)
                {
                    int mm = (ll + rr) / 2;
                    cout << "? " << mm + 1 << " " << i + m + 2 << endl;
                    cout.flush();
                    fflush(stdout);
                    cin >> f1;
                    if (mm == i + m)
                        f2 = 1;
                    else
                    {
                        cout << "? " << mm + 1 << " " << i + m + 1 << endl;
                        cout.flush();
                        fflush(stdout);
                        cin >> f2;
                    }
                    if (f1 == f2)
                        ll = mm;
                    else
                        rr = mm;
                }
                t1.push_back(t1[ll - l]);
                gg[t2[i]] = t1[ll - l];
            }
        }
    }
    return t1;
}


int main()
{
    //freopen("video.in", "r", stdin);
    //freopen("video.out", "w", stdout);
    int n;
    cin >> n;
    vector <int> ans = get(0, n - 1);
    cout << "Ready!" << endl;
    cout.flush();
    fflush(stdout);
    int cc = 0;
    for (int i = 0; i < n; i++)
        cc = max(cc, ans[i]);
    cout << cc << endl;
    for (int i = 0; i < n; i++)
        cout << ans[i] << " ";
}
