#include<iostream>

using namespace std;

int main(){
    int n;
    cin >> n;
    int cur = 0;
    pair<int, bool> d[n];
    for (int i = 0; i < n; ++i){
        d[i] = {0, false};
    }
    int cnt = 1;
    for (int i = 0; i < n; ++i){
        cout << "? " << 1 << " " << i + 1 << endl;
        int ans;
        cin >> ans;
        if (ans == cur){
            int cur1 = cur;
            int ind = 1;
            while (true){
                cout << "? " << ind + 1 << " " << i + 1 << endl;
                int a;
                cin >> a;
                if (a == cur1 && !d[ind - 1].second){
                    d[ind - 1].second = true;
                    d[i] = {d[ind - 1].first, false};
                    break;
                }
                ind++;
                cur1 = a;
            }
        }
        else{
            d[i].first = cnt;
            cnt++;
        }
        cur = ans;
    }
    cout << "Ready!" << endl;
    cout << cnt - 1 << endl;
    for (int i = 0; i < n; ++i){
        cout << d[i].first << " ";
    }
    cout << endl;
}
