#include<bits/stdc++.h>
using namespace std;
int a[100000],t,m,n,k;
int main()
{
	freopen("meow.in","r",stdin);
	freopen("meow.out","w",stdout);
	ios::sync_with_stdio(false);
	cin>>t;
	while(t--)
	{
		cin>>n>>m>>k;
		for(int i=1;i<=m;i++)
		{
			cin>>a[i];
	}
	}
	cout<<5<<endl;
	cout<<1<<' '<<1<<endl;
	cout<<1<<' '<<1<<endl;
	cout<<1<<' '<<2<<endl;
	cout<<2<<' '<<1<<' '<<2<<endl;
	cout<<1<<' '<<1<<endl;
	//fclose(stdin);
	//fclose(stdout);
	return 0;
}