#include<bits/stdc++.h>
using namespace std;
vector<int> a;
signed main(){
  freopen("meow.in","r",stdin);
  freopen("meow.out","w",stdout);
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin>>T;
  while (T--){
  	cin>>n>>m>>k;
		for (int i=1;i<=m;i++){
			cin>>x;
			for (int j=1;j<=n;j++)
				if (
		}
  }
  return 0;
}
