#include"testlib.h"
#include<bits/stdc++.h>
#define all(v) v.begin(), v.end()

using namespace std;

const int T = 1e4;
const int MAX_N = 2e5;
const int MAX_Q = 2e5;

int32_t main(int argc, char *argv[]) {
    registerGen(argc, argv, 1);
    int n = 1 << 17;
    int t = 1;
    cout << t << '\n';
    for (int i = 0; i < t; ++i) {
        cout << n << ' ' << MAX_Q << '\n';
        vector<int> a(n);
        iota(all(a), 1);
        reverse(all(a));
        swap(a[n / 2], a[n / 2 + 1]);
        for (int x : a) cout <<  x << " \n"[x == a.back()];
        for (int i = 0; i < MAX_Q; ++i) {
            int l = rnd.next(1, n);
            int r = rnd.next(1, n);
            cout << min(l, r) << ' ' << max(l, r) << '\n';
        }
    }
}
