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

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

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

    int p = 1;
    for (int i = 0; i < n - 1; i++) {
        for (int j = i + 1; j < n; j++) {
            cout << "? " << i + 1 << " " << j + 1 << endl;
            cout.flush();
            int k; cin >> k;
            if (k == 1) {
                if (num[i] != -1) num[j] = num[i];
                else num[i] = num[j];
            }
            if (k == 2) {
                if (num[i] != -1) {num[j] = p; p++;}
                else {num[i] = p; p++;}
            }
        }
    }


    int kol = 0;
    for (int i = 0; i < p; i++) {
        for (int j = 0; j < n; j++) if (num[j] == i) {kol++; break;}
    }

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