#include<bits/stdc++.h>
using namespace std;
int a[100001];
int main()
{
	freopen("meow.in","r",stdin);
	freopen("meow.out","w",stdout);
	int t,n,m,k	;
	scanf("%d",&t);
	for(int q=1; q<=t; q++)
	{
		scanf("%d%d%d",&n,&m,&k);
		for(int i=1; i<=m; i++)
		{
			scanf("%d",&a[i]);
		}
	}
	for(int i=1; i<=m-2; i++) cout<<"1 1 "<<endl;
	cout<<"1 2"<<endl;
	cout<<"2 1 2"<<endl;
	cout<<"1 1"<<endl;
}
