#include <bits/stdc++.h>
using namespace std;
int n;
int a[3000];
bool b[3001];
int col(int i, int j) {
    int ans = 0;
    fill(b, b + n, false);
    for (int k = i; k <= j; k++) b[a[k]] = true;
    for (int i = 0; i < n; i++) ans += (int)(b[i]);
    return ans;
}
int get(int l, int r, int i) {
    if (l + 1 == r) return a[l];
    int m = (l + r) / 2;
    int k;
    cout << "? " << m + 1 << " " << i + 1 << "\n";
    cout.flush();
    cin >> k;
    if (k == col(m, i)) return get(m, r, i);
    return get(l, m, i);
}
int main() {
    cin >> n;
    fill(a, a + n, 1);
    int cur = 1;
    for (int i = 1; i < n; i++) {
        cout << "? " << 1 << " " << i + 1 << "\n";
        cout.flush();
        int k;
        cin >> k;
        if (col(0, i - 1) + 1 == k) {
            cur++;
            a[i] = cur;
            continue;
        }
        a[i] = get(0, i, i);
    }
    cout << "Ready!\n" << cur << "\n";
    for (int i = 0; i < n; i++) cout << a[i] << " ";
    cout << "\n";
}
