#include <cstdio>
#include <cstdlib>
#include <set>
#include <algorithm>
using namespace std;

typedef pair<int,int> PII;

set<PII> st;

int main() {
	int R = 10000;
	int C = 100000;
	int Q = 1000;
	printf("%d %d %d\n", R, C, Q);
	for (int i = 0; i < C; ++i) {
		int x = rand() % R + 1;
		int y = rand() % R + 1;
		if (x > y) swap(x, y);
		if (x ==y || st.count(PII(x, y))) { i--; continue; }
		st.insert(PII(x,y));
		printf("%d %d\n", x, y);
	}
	for (int i = 0; i < Q; ++i) {
		int x = rand() % R + 1;
		int y = rand() % R + 1;
		if (x > y) swap(x, y);
		if (x == y) { i--; continue; }
		printf("%d %d\n", x, y);
	}
}
