#include <bits/stdc++.h>

using namespace std;

int a[3001][3001];
int pref[3001];

inline int find_eq(int n) {
    int prev = pref[n];
    int l = 1, r = n - 1;

    while (l != r) {
        int m = (l + r + 1) / 2 ;
        cout << "? " << m << " " << n << endl;
        int now;
        cin >> now;

        if (now == n - m + 1) {
            r = m - 1;
            prev = now;
            continue;
        }


        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;
        }

        prev = now;
    }
    return l;
}

int main() {
    memset(a, 0, sizeof(a));
    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;
        cin >> pref[i];
    }

    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;
                }
            }
        }
    }
    cout << "Ready!" << endl << cnt << endl;
    for (int i = 1; i <= n; ++i) {
        cout << res[i] << " ";
    }
    cout << endl;
    return 0;
}


/*


int need = n;

for (int i = 2; i < n; ++i) {
    for (int j = 1; j < i; ++j) {
        if (a[i][j] == 1) {
            --need;
            break;
        }
    }
}
vector<bool> change(m + 1, false);
for (int i = m; i < n; ++i) {
    for (int j = 1; j < m; ++j) {
        if (a[i][j]) change[j] = true;
    }
}

for (int i = 1; i < m; ++i) {
    if (not change[j]) {

    }
}


        */
