#include<bits/stdc++.h>
using namespace std;
int main(){
	freopen("replace.in","r",stdin);
	freopen("replace.out","w",stdout);
	int n,m;
	cin>>n>>m;
	string s,p,j,k;
	for(int i=1;i<=n+m;i++){
		cin>>s>>p;
	}
	
	for(int t=1;t<=m;t++){
		cout<<"0"<<endl;
	}
	return 0;
}
