#include <bits/stdc++.h>

using namespace std;

int p[3000];

int total;

int get(int);

void unite(int a, int b) {
    if(get(a) != get(b)) {
        p[b] = p[a];
        total--;
    }
}

int get(int a_) {
    int a = a_;
    while(p[a] != a)
        a = p[a];
    return p[a] = a;
}

int query(int l, int r) {
    cout << "? " << l + 1 << ' ' << r + 1 << endl;
    cout.flush();
    int ret;
    cin >> ret;
    return ret;
}

int main() {
    int n;
    cin >> n;
    total = n;
    for(int i = 0; i < n; i++) {
        p[i] = i;
    }

    for(int i = 0; i < n; i++) {
        int last = -1;
        int j;
        for(j = i + 1; j < n; j++) {
            int q = query(i, j);
            if(q != 1) break;
        }
        for(int k = i; k < j; k++) unite(i, k);
    }

    cout << "Ready!" << endl << total << endl;
    cout << get(0) + 1;
    for(int i = 1; i < n; i++)
        cout << ' ' << get(i) + 1;
    cout << endl;
    return 0;
}
