#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <vector>
#include <string>
#include <cassert>
#include <utility>
#include <functional>

#define ll long long
#define ld long double
#define mp make_pair
#define TASKNAME "video"

using namespace std;

void solve() {
	int n;
	cin >> n;
	vector<int> ans(n);
	ans[0] = 1;
	int k = 1;
	vector<int> cnt(n, 1);
	vector < vector<int>> cnt2(n, vector<int>(n, 0));
	for (int i = 1; i < n; i++) {
		int t = -1;
		int tl = 0, tr = i;
		cout << "? " << 1 << " " << i + 1 << endl;
		int r = 0;
		cin >> r;
		cnt2[0][i] = r;
		cnt[i] = r;
		int rr = cnt[i - 1];
		if (r != rr) {
			ans[i] = ++k;
			continue;
		}
		while(tr - tl > 1) {
			int j = (tl + tr) / 2;
			cout << "? " << j + 1 << " " << i + 1 << endl;
			int r = 0;
			cin >> r;
			cnt2[j][i] = r;
			int rr = 0;
			if (cnt2[j][i - 1] != 0)
				rr = cnt2[j][i - 1];
			else {
				cout << "? " << j + 1 << " " << i << endl;
				cin >> rr;
				cnt2[j][i - 1] = rr;
			}
			if (rr == r)
				tl = j;
			else tr = j;
		}
		ans[i] = ans[tl];
	}
	cout << "Ready!\n" << k << endl;
	for (int i = 0; i < n; i++)
		cout << ans[i] << " ";
	cout << endl;
}

int main() {
#ifdef __DEBUG__
	//freopen("input.txt", "r", stdin);
	clock_t start = clock();
#else
	//freopen(TASKNAME".in", "r", stdin);
	//freopen(TASKNAME".out", "w", stdout);
#endif

	solve();

#ifdef __DEBUG__
	cerr << "\nTime: " << (ld)(clock() - start) / (ld)CLOCKS_PER_SEC << endl;
#endif
	return 0;
}