#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#include <map>

using namespace std;


const int INF = 1e9;

void print(vector<int> s){
    for (int i = 0; i < s.size(); i++)
        cout << s[i] << " ";
    cout << endl;
}


int main()
{
    int n;
    cin >> n;
    vector<int> answer(n);
    for (int i = 0; i < n; i++)
        answer[i] = 0;
    answer[0] = 1;
    int a = 1;
    for (int i = 1; i < n; i++){
        cout << "? 1 " << i + 1 << "\n";
        int k;
        cin >> k;
        if (k > a){
            answer[i] = k;
        }
        a = max(a, k);
    }
    int i = 0;
    while (i < n && answer[i] != 2){
        answer[i] = 1;
        i += 1;
    }
    vector<pair<int, int> > s(a);
    for (int i = 0; i < a; i++)
        s[i] = make_pair(INF, i + 1);
    a = 1;
    for (int i = 0; i < n; i++){
        if (answer[i] != 0){
            if (answer[i] > 1)
                a += 1;
            for (int j = 0; j < n; j++)
                if (s[j].second == answer[i])
                    s[j].first = i + 1;
            continue;
        }
        sort(s.begin(), s.end());
        int l = 0;
        int r = a;
        while (l + 1 < r){
            int m = (l + r) / 2;
            cout << "? " << s[m].first << " " << i + 1 << "\n";
            int k;
            cin >> k;
            if (k == a - m)
                l = m;
            else
                r = m;
        }
        answer[i] = s[l].second;
        for (int j = 0; j < n; j++)
            if (s[j].second == answer[i])
                s[j].first = i + 1;
    }
    set<int> kek;
    for (int i = 0; i < n; i++)
        kek.insert(answer[i]);
    cout << "Ready!\n";
    cout << kek.size() << "\n";
    print(answer);
    return 0;
}
