#include <bits/stdc++.h>

using namespace std;

int a[3001][3001];
int pref[3001];
int __cnt = 0;

inline int find_eq(int n) {
    int l = 1, r = n - 1;

    while (l != r) {
        int m = (l + r + 1) / 2 ;
        ++__cnt;
        assert(__cnt <= 36000);
        cout << "? " << m << " " << n << endl;

        int now;
        cin >> now;

        int uniq = n - m + 1;
        for (int i = m + 1; i < n; ++i) {
            for (int j = m; j < i; ++j) {
                if (a[i][j] == 1) {
                    --uniq;
                    break;
                }
            }
        }

        if (uniq == now) {
            r = m - 1;
        } else {
            l = m;
        }
    }
    return r;
}

int main() {
    memset(a, 0, sizeof(a));
    memset(pref, 0, sizeof(pref));
    int n;
    cin >> n;
    for (int i = 1; i <= n; ++i) {
        a[i][i] = 1;
    }
    pref[1] = 1;
    for (int i = 2; i <= n; ++i) {
        cout << "? 1 " << i << endl;
        ++__cnt;
        cin >> pref[i];
    }

    if (pref[n] == 1) {
        cout << "Ready!" << endl << 1 << endl;
        for (int i = 1; i <= n; ++i) {
            cout << 1 << " ";
        }
        cout << endl;
        return 0;
    }
    if (pref[n] == n) {
        cout << "Ready!" << endl << n << endl;
        for (int i = 1; i <= n; ++i) {
            cout << i << " ";
        }
        cout << endl;
        return 0;
    }

    for (int i = 2; i <= n; ++i) {
        if (pref[i] != pref[i - 1]) {
            for (int j = 1; j < i; ++j) {
                a[i][j] = -1;
            }
        }
        else {
            int eq = find_eq(i);
            for (int j = 1; j <= eq; ++j) {
                a[i][j] = a[eq][j];
            }
            for (int j = eq + 1; j < i; ++j) {
                a[i][j] = -1;
            }
        }
    }
    vector<int> res(n + 1);
    int cnt = 0;
    for (int i = 1; i <= n; ++i) {
        if (not res[i]) {
            res[i] = ++cnt;
            for (int j = i + 1; j <= n; ++j) {
                if (a[j][i] == 1) {
                    res[j] = cnt;
                }
            }
        }
    }
    assert(cnt == pref[n]);
    cout << "Ready!" << endl << cnt << endl;
    for (int i = 1; i <= n; ++i) {
        cout << res[i] << " ";
    }
    cout << endl;
    return 0;
}

