#include<iostream>
#include<cstdio>
#include<deque>
using namespace std;
//spj?
#define N 305
deque<int> s[N];
int t,n,m,k,x,p;
int main(){
	freopen("meow.in","r",stdin);
	freopen("meow.out","w",stdout);
	cin>>t;
	while(t--){
		cin>>n>>m>>k;
		cout<<m<<endl;
		while(m--) cin>>x,cout<<"1 1\n";
	}
	return 0;
}

