#include using namespace std; #define rep(i,n) for(int i=0;imp; int n,m;cin>>n>>m; string s; int temp; rep(i,n){ cin>>s>>temp; mp[s]=temp; } rep(i,m){ cin>>s>>temp; mp[s]=temp; } for(auto e:mp){ cout<