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

int num[100500];
int Q = 0;

bool mequal(int i) {
    cout << "? " << i << " " << i + 1 << endl; cout.flush(); Q++;
    int k;
    cin >> k;
    if (k == 1) return 1;
    if (k == 2) return 0;
}


int main() {
    int n;
    cin >> 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++) {
        if (Q >= 70000) return -1;
        cout << "? 1 " << i + 1 << endl; cout.flush(); Q++;

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

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

    int kol = 0;
    for (int i = 0; i < n; i++) kol = max(kol, num[i]);

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