#include<bits/stdc++.h>
using namespace std;
int main(){
	freopen("traverse.in","r",stdin); 
	freopen("traverse.out","w",stdout); 
	int c,t;
	cin>>c>>t;
	for(int i=1;i<=t;i++){
		int n,k;
		cin>>n>>k;
		for(int i=1;i<=n;i++){
			int x,y;
			cin>>x>>y;
		}
		for(int i=1;i<=n;i++){
			int x,y;
			cin>>x;
		}
		cout<<1<<endl;
	}
}
