#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int N=5e5+50;
int n,q;
string s[N],t[N];
int main()
{
	freopen("replace.in","r",stdin);
	freopen("replace.out","w",stdout);
	cin.tie(0)->sync_with_stdio(0);
	cin>>n>>q;
	for(int i=1;i<=n;i++)
	{
		cin>>s[i]>>t[i];
	}
	while(q--)
	{
		cout<<0<<"\n";
	}
	return 0;
}

