#include <stdio.h>
#include <bits/stdc++.h>

using namespace std;

//bool _u;

namespace AK {

typedef long long ll;
typedef double db;

#define rep(i, l, r) for(int i = l, i##end = r; i <= i##end; ++ i)
#define per(i, l, r) for(int i = l, i##end = r; i >= i##end; -- i)

template <class T>
inline void chmax(T &x,const T &y) {
	if(x < y) x = y;
}

template <class T>
inline void chmin(T &x, const T &y) {
	if(y < x) x = y;
}

inline int read() {
	int res = 0; char ch = getchar(); bool f = 1;
	for(; ch < '0' || ch > '9'; ch = getchar())
		if(ch == '-') f = 0;
	for(; ch >= '0' && ch <= '9'; ch = getchar())
		res = res * 10 + ch - '0';
	return f ? res : -res;
}

int T, n, m, k;

void Main() {
	T = read();
	while(T --) {
		n = read(); m = read(); k = read();
		rep(i, 1, m) printf("1 1\n");
	}
}

}

//bool _v;

signed main() {
	freopen("meow.in", "r", stdin);
	freopen("meow.out", "w", stdout);
	//clock_t st = clock();
	AK :: Main();
	//cerr << "time = " << (clock() - st) * 1.0 / CLOCKS_PER_SEC << endl;
	//cerr << "space = " << (&_u - &_v) / 1048576.0 << endl;
	return 0;
}
