#include <bits/stdc++.h>

using namespace std;

int main(){
    int n;
    cin >> n;
    cout << "?" << " " << 1 << " " << n << "\n";
    fflush(stdout);
    int k;
    cin >> k;
    vector <int> ans(n, 0), lv(k, -1);
    ans[0] = 0;
    lv[0] = 0;
    int uk = 0;
    for (int j = 1; j < n; j++){
        vector <pair <int, int> > so(k);
        for (int i = 0; i < k; i++){
            so[i].first = lv[i];
            so[i].second = i;
        }
        sort(so.begin(), so.end());
        reverse(so.begin(), so.end());
        int poz = -1;
        int l = 0;
        int r = uk+1;
        while (r - l > 1){
            int m = (l + r)/2;
            cout << "? " << so[m].first+1 << " " << j+1 << "\n";
            fflush(stdout);
            int v;
            cin >> v;
            if (v != uk - m + 1) l = m;
            else r = m;
        }
        cout << "? " << so[l].first+1 << " " << j+1 << "\n";
        fflush(stdout);
        int v;
        cin >> v;
        if (v == uk - l + 1) poz = -1;
        else poz = so[l].second;
     //   cout << poz << " " << uk << "a\n";
        if (poz == -1){
            lv[uk+1] = j;
            ans[j] = uk+1;
            uk++;
        }
        else{
            lv[poz] = j;
            ans[j] = poz;
        }
    }
    cout << "Ready!" << "\n";
    fflush(stdout);
    cout << k << "\n";
    fflush(stdout);
    for (int i = 0; i < n; i++){
        cout << ans[i]+1 << " ";
        fflush(stdout);
    }
    cout << "\n";
    fflush(stdout);
    return 0;
}
