import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.LinkedHashMap;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringBuffer sb = new StringBuffer("");
String m="";
LinkedHashMap<String,String>lhm =new LinkedHashMap<String, String>();
while ((m=br.readLine())!=null) {
if(m.trim().equals(""))
break;
String[]str=m.split(" ");
lhm.put(str[1], str[0]);
}
while ((m=br.readLine())!=null) {
m=m.trim();
if(lhm.containsKey(m)){
sb.append(lhm.get(m)).append("\n");
}
else{
sb.append("eh\n");
}
}
System.out.print(sb);
}
}
No comments:
Post a Comment