#include <bits/stdc++.h>

#define pb push_back
#define pii pair<int, int>
#define mp make_pair
#define fi first
#define se second
#define ll long long
#define NAME ""
#define FREOPEN freopen(NAME".in", "r", stdin); freopen(NAME".out", "w", stdout);

using namespace std;

const int N = 3001;

int n, i, j, a[N], k, Prev, kol;

int main()
{
    ios_base::sync_with_stdio(0);
    cin >> n;
    a[0] = 1;
    k = 1;
    for (i = 1; i < n; i++) {
        Prev = 1;
        for (j = i - 1; j >= 0; j--) {
            cout << "? " << j + 1 << ' ' << i + 1 << endl;
            fflush(stdout);
            cin >> kol;
            if (kol == Prev && a[j] != a[j + 1])
                a[i] = a[j];
            Prev = kol;
        }
        if (!a[i])
            a[i] = ++k;
    }
    cout << "Ready!\n" << k << endl;
    for (i = 0; i < n; i++)
        cout << a[i] << ' ';
    return 0;
}













