#include <bits/stdc++.h>

#define mp make_pair
#define pb bush_back
#define fi first
#define se second

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int N = 5e5 + 7;
const int M = 5e3 + 7;
const ll INF = 1e9 + 7;

int get(int x, int y){
    int ret;
    cout << "? " << x << " " << y << endl;
    fflush(stdout);
    cin >> ret;
    return ret;
}

bool b[N];
int an[N];

int main()
{
    //freopen("video.in", "r", stdin);
   //freopen("video.out", "w", stdout);
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int n, cnt = 0;
    cin >> n;
    for (int i = 0; i < n - 1; i++){
        int x = get(i + 1, i + 2);
        if (x == 1)
            b[i] = true;
    }
    for (int i = 0; i < n; i++){
        if (an[i] != 0)
            continue;
        cnt++;
        int u = i;
        while (1){
            while (b[u])
                an[u] = cnt, u++;
            an[u] = cnt;
            bool f = false;
            for (int j = u + 1; j < n - 1; j++){
                int x = get(u, j);
                int y = get(u, j + 1);
                int z = get(u + 1, j);
                int q = get(u + 1, j + 1);
                if (x == y && y == q && z == x - 1){
                    u = j + 1;
                    f = true;
                    break;
                }
            }
            if (!f)
                break;
        }
    }
    cout << "Ready!\n" << cnt << endl;
    for (int i = 0; i < n; i++)
        cout << an[i] << " ";
    cout << endl;
    fflush(stdout);
    return 0;
}
