#include<iostream>
#include<algorithm>
#include<string>

using namespace std;

const int maxn = 3005;

int n;
int k = 1;
int ans[maxn], arr[maxn];
bool islast[maxn];

int main() {
	ios_base::sync_with_stdio(false);
	cin >> n;
	ans[1] = arr[1] = islast[1] = 1;
	for (int i = 2; i <= n; ++i) {
		cout << "? 1 " << i << endl;
		cout.flush();
		cin >> arr[i];
		if (arr[i] == arr[i - 1]) {
			if (k == 1) ans[i] = 1;
			else {
				int p, t;
				for (int j = i - 1; j >= 1; --j) {
					if (islast[j]) {
						cout << "? " << j << " " << i << endl;
						cout.flush();
						cin >> p;
						cout << "? " << j + 1 << " " << i << endl;
						cout.flush();
						cin >> t;
						if (p == t) {
							ans[i] == ans[j];
							islast[j] = false;
							islast[i] = true;
						}
					}
				}
			}
		}
		else {
			k = arr[i];
			ans[i] = k;
			islast[i] = true;
		}
	}
	cout << "Ready!" << endl;
	cout << k << endl;
	for (int i = 1; i <= n; ++i)
		cout << ans[i] << " ";
	cout.flush();
	return 0;
}