#include <bits/stdc++.h>

using namespace std;

void read(int &x) {
    cin >> x;
}

void out(int l, int r) {
    cout << "? " << l + 1 << ' ' << r + 1 << endl;
}

void out_answer(vector<int> ans, int k) {
    cout << "Ready!" << endl;
    cout << k << endl;
    for (int i = 0; i < ans.size(); i++) {
        cout << ans[i] + 1 << ' ';
    }
    cout << endl;
}

void solve(int n) {
    vector<int> ans(n);
    vector<int> last;
    for (int i = 0; i < n; i++) {
        out(0, i);
        int p; read(p);
        if (p > last.size()) {
            ans[i] = last.size();
            last.push_back(i);
            continue;
        }
        int left = -1, right = last.size();
        while (right - left > 1) {
            int mid = (left + right) / 2;
            out(last[mid] + 1, i);
            int p; read(p);
            if (p == int(last.size()) - mid) {
                right = mid;
            } else {
                left = mid;
            }
        }
        ans[i] = ans[last[right]];
        last.erase(last.begin() + right);
        last.push_back(i);
    }
    out_answer(ans, last.size());
}

signed main() {
    ios_base::sync_with_stdio(false);

    int n;
    cin >> n;
    solve(n);
}

