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