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

using namespace std;

int n, m;
int t[1000000];
int cc[3001][3001];

int main()
{
    ios_base::sync_with_stdio(false);
    cin >> n;
    t[1] = 1;
    int ans = 1;
    cc[1][1] = 1;
    for (int i = 2; i <= n; i++)
    {
        for (int g = i - 1; g >= 1; g--)
        {
            cout << "? " << g << " " << i << endl;
            cout.flush();
            int p;
            cin >> p;
            if (cc[g][i - 1] == p)
            {
                t[i] = t[g];
                break;
            }
        }

        bool gt = false;
        for (int g = i; g >= 1; g--)
        {
            if (t[i] == t[g])
            {
                gt = true;
            }

            if (gt)
            {
                cc[g][i] = cc[g][i - 1];
            } else
            {
                cc[g][i] = cc[g][i - 1] + 1;
            }
        }

        if (t[i] == 0)
        {
            ans++;
            t[i] = ans;
        }
    }

    cout << "Ready!" << endl;
    cout.flush();
    cout << ans << endl;
    cout.flush();
    for (int i = 1; i <= n; i++)
    {
        cout << t[i];
        cout.flush();
        if (i < n)
        {
            cout << " ";
            cout.flush();
        } else
        {
            return 0;
        }
    }

    return 0;
}
