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


using namespace std;

vector<vector<int>> d;
vector<int> ans;
vector<int> last;

int get_d(int i, int j) {
    if (d[i][j] == -1) {
        cout << "? " << i + 1 << ' ' << j << endl;
        cin >> d[i][j];
    }
    return d[i][j];
}

int main() {
    int n;
    cin >> n;
    d.resize(n + 1, vector<int>(n + 1, -1));
    ans.resize(n);
    last.resize(1, 0);
    int cc = 1;
    ans[0] = 1;
    for (int i = 0; i < n; ++i) {
        d[i][i + 1] = 1;
    }
    for (int i = 2; i <= n; ++i) {
        if (get_d(0, i) == cc + 1) {
            ans[i - 1] = ++cc;
            last.push_back(i - 1);
            continue;
        }
        if (get_d(0, i) == 1) {
            ans[i - 1] = 1;
            last[0] = i - 1;
            continue;
        }
        vector<int> slast = last;
        sort(slast.begin(), slast.end());
        reverse(slast.begin(), slast.end());
        for (int j = 0; j < cc; ++j) {
            if (get_d(slast[j], i) == get_d(slast[j] + 1, i)) {
                ans[i - 1] = ans[slast[j]];
                slast[ans[i - 1] - 1] = i - 1;
                break;
            }
        }
    }
    cout << "Ready!\n";
    cout << d[0][n] << '\n';
    for (int i : ans) {
        cout << i << ' ';
    }
    cout << endl;

    return 0;
}
