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

using namespace std;

bool find(int *a, int *b, int my)
{
    while (a != b)
    {
        if (*a == my)
            return true;
        a++;
    }
    return *a == my;
}

int main() {
    //freopen("video.in", "r", stdin);
    //freopen("video.out", "w", stdout);
    int n;
    cin >> n;
    int res[n];
    vector<vector<int>> dif(n, vector<int>(n));
    res[0] = 1;
    dif[0][0] = 1;
    int next = 2;
    for (int i = 1; i < n; i++) //counting res[i]
    {
        int left = -1, right = i, middle;
        while (left + 1 != right)
        {
            middle = (left + right) / 2;
            cout << "? " << middle + 1 << " " << i + 1 << endl; //interval middle:i
            int a;
            cin >> a;
            if (a == dif[middle][i - 1])
                left = middle;
            else
                right = middle;
        }
        if (left == -1)
        {
            res[i] = next;
            next++;
        }
        else
            res[i] = res[left];
        dif[0][i] = next - 1;
        for (int j = 1; j <= i; j++)
        {
            if (find(res + j, res + i, res[j - 1]))
                dif[j][i] = dif[j - 1][i];
            else
                dif[j][i] = dif[j - 1][i] - 1;
        }
    }
    cout << "Ready!" << endl << next - 1 << endl;
    for (int i = 0; i < n; i++)
        cout << res[i] << " ";
}
