#include <iostream>
#include <stdio.h>
#include <set>
#include <vector>
#include <algorithm>

using namespace std;
int a[3000];
vector<int> merg(vector<int> a, vector<int> b, int l, int R, int col) {
    for (int i = 0; i < a.size(); i++) {
        //cout << a[i] << ' ';
    }
    for (int i = 0; i < b.size(); i++) {
        //cout << b[i] << ' ';
    }
    vector<int> ans;
    int mid = (l + R) / 2;
    int n = R - l + 1;
    set<int> q;
    for (int i = l; i <= mid; i++) {
        ans.push_back(a[i - l]);
    }
    int mn = col;
    for (int i = 0; i < b.size(); i++) {
        q.insert(b[i]);
    }
    set<int> help;
    //help.insert(b[0]);
    //cout << mid << endl;
    for (int i = 0; i < b.size(); i++) {
        int in = 0;
        int out = 0;
        if (help.count(b[i]) == 0) {
            cout << "? " << l << ' ' << mid + i + 1 << endl;
            cout.flush();
            cin >> out;
            cout << "? " << l + 1 << ' ' << mid + i + 1 << endl;
            cout.flush();
            cin >> in;
            if (in == out) {
                int x = 1;
                while (in == out && l + x <= mid) {
                    cout << "? " << l + x + 1 << ' ' << mid + i + 1 << endl;
                    cout.flush();
                    cin >> in;
                    cout << "? " << l + x << ' ' << mid + i + 1 << endl;
                    cout.flush();
                    cin >> out;
                    x++;
                }
                for (int d = i + 1; d < b.size(); d++) {
                    if (b[d] == b[i]) {
                        b[d] = a[x - 2];
                    }
                }
                b[i] = a[x - 2];
            }
            help.insert(b[i]);
        }
    }
    for (int i = 0; i < b.size(); i++) {
        ans.push_back(b[i]);
    }
    set<int> qwert;
    for (int i = 0; i < ans.size(); i++) {
        qwert.insert(ans[i]);
    }
    int cnt1 = 0;
    for (auto elem : qwert) {
        for (int i = 0; i < ans.size(); i++) {
            if (ans[i] == elem) {
                ans[i] = cnt1 + col;
            }
        }
        cnt1++;
    }
    return ans;
}
vector<int> go(int l, int r, int col) {
    vector<int> ans;
    int n = r - l + 1;
    for (int i = 0; i < n; i++) {
        ans.push_back(col);
    }
    if (n == 1) {
        return ans;
    } else {
        vector<int> ans1 = go(l, (l + r)/ 2, col);
        set<int> q;
        for (int i = 0; i < ans1.size(); i++) {
            q.insert(ans1[i]);
        }
        vector<int> ans2 = go((l + r) / 2 + 1, r, col + q.size());
        return merg(ans1, ans2, l, r, col);
    }
}
int main() {
    //freopen("video.in", "r", stdin);
    //freopen("video.out", "w", stdout);
    int n;
    set<int> pp;
    cin >> n;
    vector<int> ans = go(1, n, 1);
    cout << "Ready!" << endl;
    for (int i = 0; i < ans.size(); i++) {
        pp.insert(ans[i]);
    }
    cout << pp.size() << endl;
    for (int i = 0; i < ans.size(); i++) {
        cout << ans[i] << ' ';
    }
}
