#include <iostream>
#include <stdio.h>
#include <string>
#include <algorithm>
#include <map>
#include <vector>
using namespace std;
typedef long long ll;
const ll inf = 1000000007;

int b[3005], ans[3005];

int main() {
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	//freopen("video.in", "r", stdin);
	//freopen("video.out", "w", stdout);
	int n, k = 0;
	cin >> n;
	map<int, int> m;
	vector<pair<int, int>> v;
	for (int i = 0; i < n; i++) {
		cout << "? 1 " << i + 1 << endl;
		int p;
		cin >> p;
		if (p > k) ans[i] = p, b[k++] = p;
		if (!ans[i]) {
			for (auto it : m)
				v.push_back(make_pair(it.second, it.first));
			sort(v.begin(), v.end());
			for (int j = 0; j < v.size(); j++) {
				cout << "? " << v[j].first + 2 << ' ' << i + 1 << endl;
				int e;
				cin >> e;
				if (e != k - j - 1) {
					ans[i] = v[j].second;
					break;
				}
			}
		}
		m[ans[i]] = i;
	}
	cout << "Ready!" << endl << k << endl;
	for (int i = 0; i < n; i++)
		cout << ans[i] << ' ';
	cout << endl;
	return 0;
}