#include <iostream>
#include <bits/stdc++.h>

using namespace std;
/*vector<int> arr;
int t;
int l(int i, int j)
{
    set<int> q;
    for (int z = i; z <= j; z++)
        q.insert(arr[z]);
    return q.size();
}*/

int f(int i, int j)
{
    cout << "? " << i + 1 << " " << j + 1 << endl;
    int x;
    //x = l(i, j);
    cin >> x;
    return x;
}

int main()
{
    int n;
    cin >> n;
    if (n <= 300)
    {
        int arr[n][n];
        for (int i = 0; i < n; i++)
        {
            for (int j = i; j < n; j++)
            {
                arr[i][j] = f(i, j);
            }
        }
        int q[n];
        for (int i = 0; i < n; i++)
            q[i] = 0;
        int x = 0;
        while (true)
        {
            bool e = false;
            int last = 0;
            for (int i = 0; i < n; i++)
            {
                if (q[i] == 0)
                {
                    e = true;
                    last = i;
                    x++;
                    q[i] = x;
                    break;
                }
            }
            for (int i = 0; i < n; i++)
            {
                if (q[i] == 0 && i > last)
                {
                    if (arr[last][i] == arr[last + 1][i])
                    {
                        last = i;
                        q[i] = x;
                    }
                }
            }
            if (!e)
                break;
        }
        cout << "Ready!" << endl;
        cout << arr[0][n - 1] << endl;
        for (int i = 0; i < n; i++)
            cout << q[i] << " ";
        cout << endl;
        return 0;
    }
    /*for (int i = 0; i < 10; i++)
        arr.push_back(i + 1);
    for (int i = 10; i < n; i++)
    {
        int x;
        //cin >> x;
        x = rand() % 10 + 1;
        arr.push_back(x);
    }*/
    int q[n];
    for (int i = 0; i < n; i++)
        q[i] = 0;
    int x = 0;
    while (true)
    {
        bool e = false;
        int last = 0;
        for (int i = 0; i < n; i++)
        {
            if (q[i] == 0)
            {
                e = true;
                last = i;
                x++;
                q[i] = x;
                break;
            }
        }
        for (int i = 0; i < n; i++)
        {
            if (q[i] == 0 && i > last)
            {
                if (f(last, i) == f(last + 1, i))
                {
                    last = i;
                    q[i] = x;
                }
            }
        }
        if (!e)
            break;
    }
    int res;
    res = f(0, n - 1);
    cout << "Ready!" << endl;
    cout << res << endl;
    for (int i = 0; i < n; i++)
        cout << q[i] << " ";
    cout << endl;
    //cout << t << endl;
    return 0;
}
