#include <iostream>
#include <cstdio>
#include <cassert>
#include <cmath>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
#include <unordered_map>
#include <string>
#include <cstring>
#include <tuple>
#include <bitset>
#include <cstdlib>
#define mp make_pair
#define pb push_back
#define NAME ""
#define mt make_tuple
#define y1 y11

using namespace std;

typedef long long ll;
typedef long double ld;

const int nmax = 3010;
const int inf = 1000 * 1000 * 1000;
const int mod = 1000 * 1000 * 1000 + 7;
const int force = 27;
const ld pi = acos(-1.0);

int n, a[nmax], q, gg[nmax][nmax];
bool used[nmax];

int main() {
	cin >> n;
	a[0] = 1;
	int top = 2;
	gg[0][0] = 1;
	for (int i = 1; i < n; i++) {
		int l = -1, r = i;
		while (r - l > 1) {
			int m = l + (r - l) / 2;
			cout << "? " << m + 1 << " " << i + 1 << endl;
			cin >> q;
			if (q - gg[m][i - 1] == 1) {
				r = m;
			} else {
				l = m;
			}
		}
		if (l == -1) {
			a[i] = top++;
		} else {
			a[i] = a[l];
		}
		for (int j = 0; j < n; j++) {
			used[j] = 0;
		}
		int cnt = 0;
		for (int j = i; j >= 0; j--) {
			if (!used[a[j]]) {
				cnt++;
			}
			used[a[j]] = true;
			gg[j][i] = cnt;
		}
	}
	cout << "Ready!" << endl << top - 1 << endl;
	for (int i = 0; i < n; i++) {
		cout << a[i] << " ";
	}
	cout << endl;
}