#include<bits/stdc++.h>
using namespace std;
int t,m,a[100000],n,k;
int main()
{
	freopen("meow.in","r",stdin);
	freopen("meow.out","w",stdout);
	cin>>t;
    for (int ii=1;ii<=t;ii++)
    {
    	cin>>n>>m>>k;
    	for (int i=1;i<=m;i++) cin>>a[i];
    	cout<<m<<endl;	
		for (int i=1;i<=m;i++) cout<<1<<' '<<1<<endl;
	}
}
