#include #include using namespace std; int main(){ int n,m;cin>>n>>m; map A; for(int i = 0; n+m > i; i++){ string s;int t;cin>>s>>t; A[s] = t; } for(auto x: A){ cout << x.first << " " << x.second << endl; } }