#include <bits/stdc++.h>
#define fr(i, n) for (int i = 0; i < n; i++)
#define frab(i, a, b) for (int i = a; i < b; i++)
#define pb push_back
#define mp make_pair

using namespace std;

typedef long long ll;
typedef long double ld;

const int N = 1e3 + 1;
const int INF = 2e9 + 1;

int a[N];

map <pair <int, int>, int > m1;

int main() {
    //freopen("video.in", "r", stdin);
    //freopen("video.out", "w", stdout);
    int n;
    int q = 0;
    cin >> n;
    int cur = 1;
    fr(i, n)
        //if (!a[i]) {
        {
            if (!a[i])
                a[i] = cur++;
            int l = i;
            frab(r, l + 1, n) {
                int x1, x2, x3;
                //cout << "? " << l + 1 << " " << r + 1 << endl;
                //cin >> x1;
                if (m1.count(mp(l + 1, r + 1)))
                    x2 = m1[mp(l + 1, r + 1)];
                else if (l + 1 == r + 1)
                    x2 = 1;
                else {
                    cout << "? " << l + 1 << " " << r + 1 << endl;
                    cin >> x2;
                    m1[mp(l + 1, r + 1)] = x2;
                    q++;
                }
                if (m1.count(mp(l + 2, r + 1)))
                    x3 = m1[mp(l + 2, r + 1)];
                else if (l + 2 == r + 1)
                    x3 = 1;
                else {
                    cout << "? " << l + 2 << " " << r + 1 << endl;
                    cin >> x3;
                    m1[mp(l + 2, r + 1)] = x3;

                    q++;
                }
                if (x2 == x3) {
                    a[r] = a[l];
                    break;
                }
            }
            //assert(q <= 72000);
        }
    cout << "Ready!" << endl;
    cout << cur - 1 << endl;
    fr(i, n)
        cout << a[i] << " ";
}
