#include <bits/stdc++.h>
using namespace std;
int a[100000],b[100000];
int t,n,m,v,c,d;
int main(){
    freopen("assign.in","r",stdin);
    freopen("assign.out","w",stdout);
    int cd[100005];
    cin>>t;
    for(;t>=1;t--){
        cin>>n>>m>>v;
        //buf clear
        for(register int*p=cd;p<=cd+m;p++){
            *p=0;
        }
        //
        for(int i=1;i<=m;i++){
            cin>>c>>d;
            cd[c]=d;
            //fprintf(stderr,"%d\n",cd[c]);
        }


    }
    
}
 