#include<bits/stdc++.h>
using namespace std;
int t,n,m,k,a[301],an;
deque<int> zh[301];
vector<int> zz[301];
bool tt;
struct dd{
	int lx,xx,yy;
}ans[3000001];
int read()
{
	int sum=0;
	char ch=getchar();
	while(ch<'0'||ch>'9')
	  ch=getchar();
	while(ch>='0'&&ch<='9')
	{
		sum=sum*10+ch-'0';
		ch=getchar();
	}
	return sum;
}
void write(int x)
{
	if(x>=10)
	  write(x/10);
	putchar(x%10+'0');
}
void dfs(int cs)
{
	if(cs==m)
	{
		tt=true;
		return;
	}
	for(int i=1;i<=n;i++)
	{
		for(int j=0;j<zz[a[cs+1]].size();j++)
		  if(zh[i].empty())
		  {
			int ts=zz[a[cs+1]][j];
			zh[ts].pop_back();
		//	zz[a[cs+1]]=zh[ts].back();
			dfs(cs+1);
		//	zz[a[cs+1]]=ts;
			zh[ts].push_back(a[cs+1]);
			if(tt)
			{
				ans[cs+1].lx=2;
				ans[cs+1].xx=ts;
				ans[cs+1].yy=i;
				return;
			}
	      }
		{
		//	if(zh[i].empty())
		//	  zz[a[cs+1]]
		}
	}
}
int main()
{
	freopen("meow.in","r",stdin);
	freopen("meow.out","w",stdout);
	t=read();
	for(int ii=1;ii<=t;ii++)
	{
		n=read(),m=read(),k=read();
	//	write(n),putchar(' '),write(m),putchar(' '),write(k),putchar('\n');
	  //  for(int i=1;i<=n;i++)
	 //     a[i]=read(),zz[i]=0;
	    tt=false;
	    write(1),putchar('\n'),write(1),putchar(' '),write(1);
	}
	fclose(stdin);fclose(stdout);
	return 0;
}