#include <bits/stdc++.h>

#define vec vector
#define pb push_back
#define forn(i, n) for (int i = 0; i < n; i++)

using namespace std;

int n;
vec<int> ans;
int color = 0;

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

void ok()
{
    cout << "Ready!" << endl;
    cout.flush();
    cout << color + 1 << endl;
    cout.flush();
    forn(i, ans.size())
        cout << ans[i] + 1 << ' ';
    cout.flush();
    exit(0);
}
int main()
{
    cin >> n;
    ans.pb(0);
    if (n == 1)
        ok();
    int r =0;
    while(r < n - 1)
    {
        //forn(i, ans.size())
        //    cout << ans[i] << ' ' ;
        //cout << endl;
        r++;
        int q = ask(r - 1, r);
        if (q == 1)
        {
            ans.pb(ans[r - 1]);
        }
        else
        {
            set<int> se;
            se.insert(ans[r - 1]);
            bool f = false;
            for (int i = r - 2; i >= 0; i--)
            {
                int q = ask(i, r);
                se.insert(ans[i]);
                if (q == se.size())
                {
                    ans.pb(ans[i]);
                    f = true;
                    break;
                }
            }
            if (!f)
            {
                color++;
                ans.pb(color);
            }
        }
    }
    ok();
}
