#include <bits/stdc++.h>
using namespace std;
const int maxn = 3010;
int ans[maxn];

//#define DEBUG

#ifdef DEBUG
    int t[maxn];
    int get(int l, int r) {
        t[1] = 1;
        t[2] = 1;
        t[3] = 2;
        set<int> ans;
        for (int i = l; i <= r; ++i) ans.insert(t[i]);
        return ans.size();
    }
#else
    int get(int l, int r) {
        cout << '?' << ' ' << l << ' ' << r << endl;
        int d;
        cin >> d;
        return d;
    }
#endif // DEBUG


int main() {
    int n;
    cin >> n;
    int k = get(1, n);
    ans[n] = 1;
    for (int l = n - 1; l >= 1; --l) {
        int r;
        if (get(l, n) != get(l + 1, n)) {
            r = n + 1;
        } else {
            if (get(l, l + 1) == 1) {
                r = l + 1;
            } else {
                int L = l + 1, R = n, M;
                while (R > L + 1) {
                    M = (L + R) >> 1;
                    if (get(l, M) == get(l + 1, M)) R = M;
                    else L = M;
                }
                r = R;
            }
        }
        cerr << l << ' ' << r << endl;
        if (r == n + 1) {
            set<int> s;
            for (int i = 1; i <= k; ++i) s.insert(i);
            for (int i = l + 1; i <= n; ++i) s.erase(ans[i]);
            ans[l] = *s.begin();
        } else {
            ans[l] = ans[r];
        }
    }
    cout << "Ready!" << endl;
    cout << k << endl;
    for (int i = 1; i <= n; ++i) cout << ans[i] << ' ';
    cout << endl;
    return 0;
}

