23 lines
591 B
Java
23 lines
591 B
Java
import java.util.*;
|
|
|
|
public class _17219 {
|
|
public static void main(String[] args){
|
|
Scanner sc = new Scanner(System.in);
|
|
String[] num = sc.nextLine().split(" ");
|
|
int N = Integer.parseInt(num[0]);
|
|
int M = Integer.parseInt(num[1]);
|
|
|
|
Map<String, String> keychain = new HashMap<>();
|
|
for(int i=0; i<N; i++){
|
|
String[] str = sc.nextLine().split(" ");
|
|
keychain.put(str[0],str[1]);
|
|
}
|
|
|
|
for(int i=0; i<M; i++){
|
|
System.out.println(keychain.get(sc.nextLine()));
|
|
}
|
|
|
|
sc.close();
|
|
}
|
|
}
|