#include <bits/stdc++.h>

using std::cin;
using std::cout;
using std::cerr;

using std::vector;
using std::string;
using std::pair;
using std::make_pair;

using std::min;
using std::max;
using std::abs;

template <typename T>
T input() {
    T res;
    cin >> res;
    return res;
}

uint32_t n;

uint32_t get(uint32_t i, uint32_t j) {
    assert(i <= j and j < n);
    cout << "? " << i + 1 << " " << j + 1 << std::endl;
    return input<uint32_t>();
}

uint32_t count_different(const vector<uint32_t>& data, uint32_t l, uint32_t r) {
    std::set<uint32_t> set;
    for (uint32_t i = l; i <= r; ++i)
        set.insert(data[i]);
    return set.size();
}

int main() {
    std::iostream::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    n = input<uint32_t>();
    vector<uint32_t> restored;
    vector<uint32_t> num_different;

    for (uint32_t i = 0; i != n; ++i)
        if (i == 0) {
            restored.push_back(0);
            num_different.push_back(1);
        } else {
            if (get(0, i) == num_different.back() + 1) {
                restored.push_back(num_different.back());
                num_different.push_back(num_different.back() + 1);
            } else {
                uint32_t l = 0;
                uint32_t r = i + 1;
                while (r - l > 1) {
                    uint32_t mid = l + (r - l) / 2;
                    if (count_different(restored, i + 1 - mid, i - 1) == get(i + 1 - mid, i))
                        r = mid;
                    else
                        l = mid;
                }
                restored.push_back(restored[i + 1 - r]);
                num_different.push_back(num_different.back());
            }
        }

    cout << "Ready!\n";
    cout << num_different.back() << "\n";
    for (uint32_t i = 0; i != n; ++i)
        cout << restored[i] + 1 << " ";
    cout << "\n";
    return 0;
}