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


using namespace std;

int main() {
    int n;
    cin >> n;
    vector<vector<int>> d(n + 1, vector<int>(n + 1));
    vector<int> ans(n);
    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) {
        cout << "? 1 " << i << endl;
        cin >> d[0][i];
        if (d[0][i] > d[0][i - 1]) {
            ans[i - 1] = ++cc;
        } else if (d[0][i] == 1) {
            ans[i - 1] = 1;
        } else {
            set<int> eq(ans.begin(), ans.begin() + i - 1);
            for (int j = i - 2; j > 0; --j) {
                cout << "? " << j + 1 << ' ' << i << endl;
                cin >> d[j][i];
                if (d[j][i] == 1) {
                    eq.clear();
                    eq.insert(ans[i - 2]);
                    break;
                }
                if (d[j][i] > d[j + 1][i]) {
                    eq.erase(ans[j]);
                }
                if (eq.size() == 1) {
                    break;
                }
            }
            ans[i - 1] = *eq.begin();
        }
    }
    cout << "Ready!\n";
    cout << d[0][n] << '\n';
    for (int i : ans) {
        cout << i << ' ';
    }
    cout << endl;

    return 0;
}
