#include <iostream>
#include <iomanip> 
#include <algorithm>
#include <cmath>
#include <string>
#include <cstdio>
using namespace std;
long long A[5000010],B[5000010],t[500010][5];
int main(){
	freopen("replace.in","r",stdin);
	freopen("replace.out","w",stdout);
	long long n,m,q,k,i,j;
	string s1,s2,s3,s4;
	cin>>n>>q;
	for(i = 1 ; i <= n ; i++) cin>>s1>>s2;
	for(i = 1 ; i <= q ; i++) cin>>s3>>s4;
	cout<<"0"<<endl<<"0"<<endl<<"0"<<endl<<"0";
	fclose(stdin);
	fclose(stdout);
	return 0;
}
