#include<bits/stdc++.h>
#define LL long long
using namespace std;
const int N = 2e6 + 10;
int T,n,m,k,op,a[N];
int read() {
	int x = 0,f = 1;
	char c = getchar();
	while(c < '0' || c > '9') {
		if(c == '-')	f = -1;
		c = getchar();
	}
	while(c >= '0' && c <= '9') {
		x = (x << 1) + (x << 3) + (c ^ 48);
		c = getchar();
	}
	return x * f;
}
int main() {
	freopen("meow.in","r",stdin);
	freopen("meow.out","w",stdout);
	T = read();
	while(T --) {
		n = read(),m = read(),k = read(),op = 0;
		for(int i = 1;i <= m;i ++)	a[i] = read();
		if(m == 4) {
			printf("5\n1 1\n1 1\n1 2\n2 1 2\n1 1\n");
		}
		if(m == 10) {
			printf("15\n1 1\n1 1\n1 1\n1 1\n1 1\n");
			printf("1 2\n1 2\n1 2\n1 2\n1 3\n");
			printf("2 1 3\n2 1 2\n2 1 2\n2 1 2\n2 1 2\n");
		}
	}
	return 0;
}