#include <iostream>
#include <vector>
#include <list>

using namespace std;

int lastKnown = 0;
vector<vector<int>> q;
vector<int> a;

int API(int left, int right) {
  if (right <= lastKnown) {
    set<int> x;
    for (int i = left; i <= right; i++) x.insert(a[i]);
    return x.size();
  }
  if (left == right) return 1;
  if (q[left][right] > 0) return q[left][right];
  cout << "? " << left + 1 << " " << right + 1 << endl;
  cout.flush();
  int ans;
  cin >> ans;
  q[left][right] = ans;
  return ans;
}

int main(void) {
  int n, k = 1, res1, res2;
  cin >> n;
  a = vector<int>(n, 0);
  list<pair<int, int>> last;
  q = vector<vector<int>>(n, vector<int>(n, 0));
  a[0] = 1;
  last.push_front(make_pair(0, 1));

  for (int i = 1; i < n; i++) {
    lastKnown = i;
    if (API(0, i) == k) {
      for (list<pair<int, int>>::iterator p = last.begin(); p != last.end(); p++) {
        res1 = API(p->first, i);
        res2 = API(p->first, i - 1);
        if (res1 == res2) {
          a[i] = p->second;
          last.erase(p);
          break;
        }
      }
    }
    if (a[i] == 0) {
      a[i] = ++k;
    }
    last.push_front(make_pair(i, a[i]));
  }
  cout << "Ready!\n" << k << endl;
  for (int i = 0; i < n; i++) {
    cout << a[i] << " ";
  }
  cout << endl;
  cout.flush();
  return 0;
}
