#include <bits/stdc++.h>
#define x first
#define y second
#define pb push_back
#define point pair <int, int>
#define For(i, a, b) for(int i = a; i < b; ++i)
#define Out(i, a, b) for(int i = a - 1; i >= b; --i)
#define files(FileName) read(FileName); write(FileName)
#define read(FileName) freopen((FileName + ".in").c_str(), "r", stdin)
#define write(FileName) freopen((FileName + ".out").c_str(), "w", stdout)

using namespace std;

string FileName = "video";

typedef long long base;

int n;
int used[3001];
int DSU[3001];

int main() {
    ios::sync_with_stdio(false);
    //files(FileName);
    cin >> n;
    For(i, 0, n) DSU[i] = i;
    int Last = -1, cnt = 0;
    used[0] = 1;
    For(i, 0, n) {
        if (used[i] != 1) continue;
        int k = 1;
        int L = i, R = i + 1;
        while (R < n) {
            cout << '?' << ' ' << L + 1 << ' ' << R + 1 << endl;
            int K; cin >> K;
            if (K == 1) {
                used[R] = 2;
                DSU[R] = DSU[i];
            }
            if (k != K && !used[R]) {
                used[R] = true;
                if (Last == -1) {
                    ++cnt; DSU[R] = cnt;
                } else {
                    DSU[R] = Last;
                }
                k = K;
            }
            if (Last != -1 && k == cnt + 1) break;
            ++R;
        }
        Last = DSU[i];
    }
    cout << "Ready!" << endl;
    cout << cnt + 1 << endl;
    For(i, 0, n) cout << DSU[i] + 1 << ' ';
}

