#include <bits/stdc++.h>

using namespace std;

#define pb push_back
#define mp make_pair
#define size(x) (int) x.size()
#define all(x) x.begin(), x.end()

const int maxn = 3005;
const int logn = 12;
const int inf = (int) 1e9;
const long long mod = (long long) 1e9 + 7;
const long long l_inf = (long long) 4e18;

int n, k = 0;
int res[maxn];
int last[maxn];
int diff[maxn][maxn];

inline int get(int i, int j) {
    if (i > j)
        return 0;
    if (i == j)
        return 1;
    if (diff[i][j] != 0)
        return diff[i][j];

    cout << "? " << i << ' ' << j << '\n';
    cout.flush();

    cin >> diff[i][j];
    return diff[i][j];
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    srand(566);

    cin >> n;

    res[1] = ++k;
    last[k] = 1;
    for (int i = 2; i <= n; i++) {
        if (get(1, i) != get(1, i - 1)) {
            res[i] = ++k;
            last[k] = i;
            continue;
        }
        for (int j = 1; j <= k; j++) {
            if (get(last[j], i - 1) == get(last[j], i) && get(last[j] + 1, i) == get(last[j], i)) {
                res[i] = j;
                last[j] = i;
                break;
            }
        }
    }

    cout << "Ready!\n" << k << '\n';
    for (int i = 1; i <= n; i++)
        cout << res[i] << ' ';
    cout.flush();

    return 0;
}
