#include <bits/stdc++.h>
using namespace std;

int get_num(int i, int j) {
	cout << "? " <<  ++i << ' ' << ++j << endl;
	int result; cin >> result;
	return result;
}

void put_ans(int d, const vector<int> &ans) {
	cout << "Ready!" << endl;
	cout << d << endl;
	copy(ans.begin(), ans.end(), ostream_iterator<int>(cout, " "));
	cout << endl;
}


void onk() {
	int n; cin >> n;
 	vector<int> ans(n, 0);
	ans[0] = 1;
	int cd = 1;
	set<int> rlast;
	rlast.insert(-0);
	for (int i = 1; i < n; ++i) {
		int cnum = get_num(0, i);
		if (cnum > cd) {
			ans[i] = ++cd;
			rlast.insert(-i);
		}	else {
			for (auto e: rlast) {
				int j = -e;
				if (get_num(j, i - 1) == get_num(j, i)) {
					rlast.erase(-j);
					rlast.insert(-i);
					ans[i] = ans[j];
					break;
				}
			}
		}
	}
	put_ans(cd, ans);
}

int main() {
	ios_base::sync_with_stdio(false);
	onk();
}

