#include "testlib.h"
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
// #include <ext/pb_ds/tree_policy.hpp>
// #include <ext/pb_ds/assoc_container.hpp>
 
// constexpr int MAX_N = 1'000'000;
// constexpr int MAX_A = (int)1e9;
 
constexpr int N_MAX = (int)2e5;
constexpr int Q_MAX = (int)2e5;
constexpr int A_MAX = (int)6e6;
 
const int MAX_N[] = {
	N_MAX, // sample
	3,
	1000,
	1000,
	100000,
	100000,
	N_MAX,
	N_MAX,
	N_MAX,
	N_MAX
};
 
const int MAX_Q[] = {
	Q_MAX, // sample
	Q_MAX,
	1000,
	Q_MAX,
	100000,
	Q_MAX,
	Q_MAX,
	Q_MAX,
	Q_MAX,
	Q_MAX
};
 
const int MAX_A[] = {
	A_MAX,
	A_MAX,
	A_MAX,
	A_MAX,
	A_MAX,
	A_MAX,
	20,
	1000,
	A_MAX,
	A_MAX
};
 
signed main(int argc,char* argv[]){
	registerGen(argc,argv,1);
 
	int group = atoi(argv[1]);
	int n = MAX_N[group];
	int q = MAX_Q[group];
 
	std::cout << n << " " << q << "\n";
	for(int i = 0; i < n; i++){
		int x = rnd.next(1,MAX_A[group]);
		std::cout << x;
		if(i != n-1)
			std::cout << " ";
	}
	std::cout << "\n";
 
	for(int i = 1; i <= q; i++){
		int l,r;
		l = rnd.next(1,n);
		r = rnd.next(l,n);
		if(group == 8)
			l = 1;
		std::cout << l << " " << r << "\n";
	}
 
	return 0;
}
