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