#pragma comment(linker, "/Stack:512000000")
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <vector>
#include <string>
#include <algorithm>
#include <cstring>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>

using namespace std;

#define all(x) (x).begin(), (x).end()

typedef long long LL;
typedef double dbl;

const int INF = (int)1e9;
const int MOD = (int)1e9 + 7;
const dbl EPS = 1e-9;

unordered_map<int, unordered_map<int, int>> cache;
vector<vector<char>> g;

int ask(int i, int j) {
  if (i == j) return 1;
  if (cache[i].find(j) != cache[i].end())
    return cache[i][j];
  cout << "? " << i + 1 << ' ' << j + 1 << '\n';
  cout.flush();
  int ans;
  cin >> ans;
  return cache[i][j] = ans;
}

int cnt = 1;
vector<int> ans;

void dfs(int v) {
  ans[v] = cnt;

  for (int i = 0; i < g[v].size(); ++i) {
    if (g[v][i] != 1 && ans[i] == 0)
      dfs(i);
  }
}

int main() {
#ifdef _DEBUG
#elif 0
# define PROB "video"
  freopen(PROB".in", "r", stdin);
  freopen(PROB".out", "w", stdout);
#endif

  int n;
  cin >> n;

  ans.resize(n);

  g.resize(n, vector<char>(n, -1));

  ask(0, n - 1);

  for (int i = 0; i < n; ++i)
    for (int j = i + 1; j < n; ++j)
      ask(i, j);

  for (int i = 0; i < n - 1; ++i) {
    int prev = 1;

    for (int j = i + 1; j < n; ++j) {
      int ans = ask(i, j);
      if (ans > prev) {
        for (int k = i; k < j; ++k)
          g[k][j] = 1, g[j][k] = 1;
      }
      else {
        int tmp = ans;
        for (int k = i + 1; k <= j; ++k) {
          if (ask(k, j) == tmp) {
            g[j][k - 1] = g[k - 1][j] = 0;
            break;
          }
          else
            tmp = ask(k, j);
        }
      }
      prev = ans;
    }
  }

  for (int i = 0; i < n; ++i) {
    int j = i;
    while (j < n && ask(i, j) == j - i + 1) 
      j++;
    --j;
    
    for (int k = i; k < j; ++k) {
      for (int l = k + 1; l <= j; ++l) {
        g[k][l] = g[l][k] = 1;
      }
    }
  }

  for (int i = 0; i < n; ++i) {
    int j = i;
    while (j < n && ask(i, j) == 1) j++;
    --j;

    for (int k = i; k < j; ++k) {
      for (int l = k + 1; l <= j; ++l) {
        g[k][l] = g[l][k] = 0;
      }
    }
  }

  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      if (i == j || g[i][j] != 0) continue;
      for (int k = 0; k < n; ++k) {
        if (g[i][k] != -1)
          g[j][k] = g[k][j] = g[i][k];
        if (g[j][k] != -1)
          g[i][k] = g[k][i] = g[j][k];
      }
    }
    for (int j = 0; j < n; ++j) {
      if (i == j || g[i][j] != 1) continue;
      for (int k = 0; k < n; ++k) {
        if (g[i][k] == 0)
          g[j][k] = g[k][j] = 1;
        if (g[j][k] == 0)
          g[i][k] = g[k][i] = 1;
      }
    }
  }

  for (int i = 0; i < n; ++i)
    if (!ans[i]) {
      dfs(i);
      cnt++;
    }

  cout << "Ready!" << '\n';
  cout << ask(0, n - 1) << '\n';
  for (int i = 0; i < n; ++i)
    cout << ans[i] << ' ';
  cout << '\n';
  cout.flush();

#ifdef _DEBUG
  freopen("output.txt", "w", stdout);
  for (int i = 0; i < n; ++i) {
    cout << ans[i] << ' ';
  }
  cout << endl;
#endif

  return 0;
}