#include <iostream>
#include <cstdio>
#include <vector>
#include <array>
#include <bitset>
#include <set>

using namespace std;

array<array<int, 3003>, 3003> subs;

array<int, 3003> numbers;

int getsub(int l, int r)
{
    if (l > r)
    {
        return 0;
    }
    if (l == r)
    {
        return 1;
    }
    if (subs[l][r] > 0)
    {
        return subs[l][r];
    }
    cout << "? " << l + 1 << " " << r + 1 << endl;
    int s;
    cin >> s;
    subs[l][r] = s;
    return s;
}

int main()
{
    int n;
    cin >> n;
    numbers[0] = 1;
    int maxno = 1;
    int total = getsub(0, n - 1);
    for (int no = 1; no < n; no++)
    {
        if (total - maxno == n - no)
        {
            for (int k = no, k < n; k++)
            {
                maxno++;
                numbers[k] = maxno;
            }
            break;
        }
        bitset<3012> can;
        int l = -1;
        int r = no;
        while (r - l > 1)
        {
            set<int> mynums;
            int m = (r + l) / 2;
            bool need = false;
            for (int i = m; i < no; i++)
            {
                if (!can[numbers[i]])
                {
                    need = true;
                }
            }
            if (need && (getsub(m, no) > getsub(m, no - 1)))
            {
                r = m;
            }
            else
            {
                l = m;
                if (need)
                {
                    /*for (int i = m; i < no; i++)
                    {
                        can[numbers[i]] = true;
                    }*/
                }
            }
        }
        if (l < 0)
        {
            maxno++;
            numbers[no] = maxno;
        }
        else
        {
            numbers[no] = numbers[l];
        }
    }
    cout << "Ready!" << endl;
    cout << maxno << endl;
    for (int i = 0; i < n; i++)
    {
        cout << numbers[i] << " ";
    }
    return 0;
}
