#include <bits/stdc++.h>
using namespace std;

int num[100500];

int main() {
    int n;
    cin >> n;
    bool dif[n][n];

    for (int i = 0; i < n; i++) num[i] = -1;
    num[0] = 0;

    int p = 1;

    int k = 1;
    int prevk = 1;
    for (int i = 1; i < n; i++) {
        cout << "? 1 " << i + 1 << endl; cout.flush();

        prevk = k;
        cin >> k;
        if (k > prevk) {num[i] = p; p++; continue;}

        int dp[i + 1];
        for (int l = i; l >= 0; l--) {
            cout << "? " << i << " " << i + 1 << endl; cout.flush();
            cin >> dp[l];
            if (l == i && dp[l] == 1) {num[i] = num[i - 1]; break;}
            if (l < i && dp[l] == dp[l + 1]) {num[i] = num[l]; break;}
        }
    }

    int kol = 0;
    for (int i = 0; i < n; i++) kol = max(kol, num[i]);
    if (kol > n) return -1;

    cout << "Ready!" << endl;
    cout << kol + 1 << endl;
    for (int i = 0; i < n; i++) cout << num[i] + 1 << " ";
    return 0;
}
