#include <iostream>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <string>

using namespace std;

const int maxn = 3000;

int n;
int v[maxn];
int help[maxn];
bool used[maxn];

int go_rasn(int a, int b) {
	for (int i = 0; i < maxn; i++) {
		help[i] = 0;
	}

	for (int i = a; i <= b; i++) {
		help[v[i]]++;
	}

	int res = 0;

	for (int i = 0; i < maxn; i++) {
		if (help[i] > 0) {
			res++;
		}
	}

	return res;
}

int it = 2;

void clear() {
	for (int i = 0; i < maxn; i++) {
		used[i] = false;
	}
}

int main() {
	scanf("%d", &n);

	v[1] = 1;

	for (int i = 2; i <= n; i++) {
		bool help = false;
		clear();
		for (int j = i - 1; j >= 1; j--) {
			int now;
			cout << "? " << j << ' ' << i << endl;
			cout.flush();
			cin >> now;

			if (go_rasn(j + 1, i) == now && !used[v[j]]) {
				v[i] = v[j];
				help = true;
				break;
			}

			used[v[j]] = true;
		}

		if (!help) {
			v[i] = it;
			it++;
		}
	}

	cout << "Ready!" << endl;

	for (int i = 1; i <= n; i++) {
		used[v[i]] = true;
	}

	int res = 0;

	for (int i = 1; i < maxn; i++) {
		if (used[i]) {
			res++;
		}
	}

	cout << res << endl;

	for (int i = 1; i <= n; i++) {
		cout << v[i] << ' ';
	}

	return 0;
}