#include<iostream>
#include<cstdio>

using namespace std;

const int N=2e5+50;

int n,q,k;
string s[N][5];

int main(){
	freopen("replace.in","r",stdin);
	freopen("replace.out","w",stdout);
	cin>>n>>q;
	for(int i=1;i<=n;i++){
		cin>>s[i][1]>>s[i][2];
	}
	for(int i=1;i<=n;i++){
		
	}
	for(int i=1;i<=q;i++){
		string a,b;
		cin>>a>>b;
		
	}
} 
