#include<bits/stdc++.h>
using namespace std;

struct zfeyz{
	string s1,s2;
};

int n,q;
zfeyz th[200010];

int main(){
	//freopen("in.in","r",stdin);
	//freopen("out.out","w",stdout);

	cin>>n>>q;
	for(int i=1;i<=n;i++){
		string s11,s22;
		cin>>th[i].s1>>th[i].s2;
		
	}
	
	for(int i=1;i<=q;i++){
		string t1,t2;
		cin>>t1>>t2;
		
	}
	
	
	
	
	return 0;
}

