#include<bits/stdc++.h>
using namespace std;
int main()
{
int n, m;
while(cin >> n)
{
getchar();
string s1, s2;
map<string, string>mp;
for(int i=1;i<=n;i++)
{
getline(cin, s1);
getline(cin, s2);
mp[s1] = s2;
}
cin >> m;
getchar();
string s3;
for(int i=1;i<=m;i++)
{
getline(cin, s3);
cout << mp[s3] << "\n";
}
}
return 0;
}
using namespace std;
int main()
{
int n, m;
while(cin >> n)
{
getchar();
string s1, s2;
map<string, string>mp;
for(int i=1;i<=n;i++)
{
getline(cin, s1);
getline(cin, s2);
mp[s1] = s2;
}
cin >> m;
getchar();
string s3;
for(int i=1;i<=m;i++)
{
getline(cin, s3);
cout << mp[s3] << "\n";
}
}
return 0;
}
Comments
Post a Comment