#include<bits/stdc++.h>
using namespace std;
int main(){
	freopen("query.in","r",stdin);
	freopen("query.out","w",stdout);
	int n;
	cin>>n;
	int a,b;
	for(int i=0;i<n;i++)	cin>>a>>b;
	int q;
	cin>>q;
	for(int i=0;i<q;i++){
		cout<<"1\n";
	}
	return 0;
}
