//I'm stupid. I'll AFO.
#include<bits/stdc++.h>
#define ll long long
#define OFFLINE
#define ull unsigned long long
using namespace std;
const int MAXN=2e6+3;
int T,n,m,k;
pair<int,int> in[MAXN];
int a[MAXN],cnt;
ll tot;
int s[303][606],head[303],tail[303];
struct Node{
    int tag,x,y;
    Node(){tag=x=y=0;}
    Node(int a,int b){tag=a,x=b;}
    Node(int a,int b,int c){tag=a,x=b,y=c;}
};
Node ans[MAXN];
int main(){
#ifdef OFFLINE
    freopen("meow.in","r",stdin);
    freopen("meow.out","w",stdout);
#endif
    ios::sync_with_stdio(false);
    cin>>T;
    srand(time(0));
    for(int tmp=1;tmp<=T;tmp++){
        cin>>n>>m>>k;
        for(int i=1;i<=m;i++){
            cout<<1<<" "<<1<<"\n";
        }
    }
    return 0;
}