#include <iostream>
#include <vector>
#include <set>
#include <iomanip>

using namespace std;

int main(){
    int n;

    cin >> n;

    vector<int> mas(n);

    for(int i = 0; i < n; ++i){
        mas[i] = i + 1;
    }

    int prev_k, cur_k;
    int maxx = 2;

    for(int i = 1; i < n; ++i){
        set<int> cur;
        prev_k = 1;

        for(int j = i - 1; j >= 0; --j){
            cout << '?' << ' ' << j + 1 << ' ' << i + 1 << endl;
            cout.flush();
            cin >> cur_k;

            if (cur.find(mas[j]) == cur.end() && prev_k == cur_k){
                mas[i] = mas[j];
                break;
            }

            prev_k = cur_k;
            cur.insert(mas[j]);
        }

        if (mas[i] >= maxx){
            mas[i] = maxx;
            maxx++;
        }
    }

    cout << "Ready!" << endl;
    cout.flush();
    cout << maxx - 1 << endl;
    cout.flush();
    for(int i = 0; i < n; ++i){
        cout << mas[i] << ' ';
    }
    cout << endl;
    cout.flush();


    return 0;
}
