#include<bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(0);
int n;
cin>>n;
map<string,string> dictionary;
string a,b;
for(int i=1;i<=n;i++){
cin>>a>>b;
dictionary[a]=b;
}
string article;
getline(cin, article);
string word;
for(char c : article) {
if(islower(c)) {
word += c;
} else {
if(!word.empty()) {
if(dictionary.find(word) != dictionary.end()) {
cout << dictionary[word];
} else {
cout << "UNK";
}
word = "";
}
cout << c;
}
}
if(!word.empty()) {
if(dictionary.find(word) != dictionary.end()) {
cout << dictionary[word];
} else {
cout << "UNK";
}
}
return 0;
}
所有全WA了,拿了0分的好成绩,求调