#include <iostream>
#include <cstdio>
#include <cassert>
#include <vector>
#include <algorithm>

using namespace std;

const int MAXN = 3e3;

int a[MAXN];
int cnt[MAXN][MAXN];

int get(int l, int r) {
    if (cnt[l][r] != -1)
        return cnt[l][r];
    printf("? %d %d\n", l + 1, r + 1);
    fflush(stdout);
    scanf("%d", &cnt[l][r]);
    return cnt[l][r];
}

void update(int i) {
    if (i == 0) {
        cnt[0][0] = 1;
        return;
    }
    int f = -1;
    for (int j = 0; j < i; j++)
        if (a[j] == a[i])
            f = j;
    for (int j = 0; j <= f; j++)
        cnt[j][i] = cnt[j][i - 1];
    for (int j = f + 1; j <= i; j++)
        cnt[j][i] = cnt[j][i - 1] + 1;
}
int last = 1;

int main() {
    //assert(freopen("input.txt", "r", stdin));
    //assert(freopen("output.txt", "w", stdout));

    int n; scanf("%d", &n);
    for (int i = 0; i < n; i++)
        for (int j = 0; j < n; j++)
            cnt[i][j] = -1;
    a[0] = last++;
    update(0);
    for (int i = 1; i < n; i++) {
        if (get(0, i) > get(0, i - 1))
            a[i] = last++;
        else {
            int l = 0, r = i;
            while (r - l > 1) {
                int m = (l + r) / 2;
                if (get(m, i) == get(m, i - 1))
                    l = m;
                else
                    r = m;
            }
            a[i] = a[l];
        }
        update(i);
    }

    printf("Ready!\n");
    fflush(stdout);
    printf("%d\n", last - 1);
    fflush(stdout);
    for (int i = 0; i < n; i++)
        printf("%d ", a[i]);
    printf("\n");
    fflush(stdout);

    return 0;
}
