#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <unordered_set>
#pragma comment(linker, "/stack:100000000")
#define ll long long
#define ld long double
#define cs(x) (int)x.size()
#define mp make_pair

using namespace std;

const int MAXN = 1001;


int query(int i, int j) {
	cout << "?" << " " << i + 1 << " " << j + 1 << endl;
	int ans;
	cin >> ans;
	return ans;
}


int main() {
	//iostream::sync_with_stdio(0);
	//cin.tie(0);
	//cout.tie(0);
	//freopen("video.in", "r", stdin);
	//freopen("video.out", "w", stdout);
	int n;
	cin >> n;
	vector<int> ans(n);
	vector<vector<int> > amount(n, vector<int>(n));
	ans[0] = 1;
	int q = 1;
	amount[0][0] = 1;
	for (int i = 1; i < n; i++) {
		if (query(0, i) != amount[0][i - 1]) {
			q++;
			ans[i] = q;
		}
		else {
			int l = 0, r = i;
			while (l != r-1) {
				int m = (l + r) / 2;
				if (query(m, i) == amount[m][i - 1])
					l = m;
				else
					r = m;
			}
			ans[i] = ans[r - 1];
		}
		unordered_set<int> exist;
		for (int j = i; j >= 0; j--) {
			exist.insert(ans[j]);
			amount[j][i] = cs(exist);
		}
	}
	cout << "Ready!" << endl;
	cout << q << endl;
	for (auto el : ans)
		cout << el << " ";
	cout << endl;
	return 0;
}