#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <fstream>
#include <algorithm>

using namespace std;

void check(multiset<pair<int, int>> & s, vector<int> & where, vector<short> & DNK, int i, int last)
{
    pair<int, int> to_delete;
    pair<int, int> to_insert;
    /**cout << "ERROR_FIND; GET PART;\n";
    for (auto j : s) {cout << j.first << " " << j.second << " | ";}
    cout << endl; **/
    for (auto j : s)
    {
        int q;
        cout << j.first + 1 << ' ' << i << endl;
        cin >> q;
        if (q == last)
        {
            DNK[i] = j.second;
            to_delete = j;
            to_insert = {i, j.second};
            break;
        }
        last = q;
    }
    s.erase( to_delete);
    s.insert(to_insert);
}


int main()
{
    int n;
    cin >> n;
    vector<short> DNK(n + 1, -1);
    multiset<pair<int, int>> s; /** {pos, num} **/
    vector<int> where(n + 1, -1);

    DNK[1] = 1;
    s.insert({1, 1});
    int last = 1;
    for (int i = 2; i <= n; i++)
    {
        int q;
        cout << 1 << ' ' << i << endl;
        cin >> q;
        if (q == last) {check(s, where, DNK, i, last);}
        else
        {
            DNK[i] = q;
            last = q;
            where[q] = i;
            s.insert({i, q});
        }
    }
    cout << "Ready!" << endl;
    for (int i = 1; i <= n; i++)
    {
        cout << DNK[i] << ' ';
    }
    cout << endl;

}
