.
package com.javarush.task.task08.task0829;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.text.DecimalFormat;
import java.util.*;
/*
Модернизация ПО
*/
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
Map<String, String> family = new HashMap<String, String>();
for (;;){
if (reader.readLine().isEmpty()) break;
String a = reader.readLine();
String b = reader.readLine();
family.put(a, b);
}
String city = reader.readLine();
for (Map.Entry<String, String> pair : family.entrySet()){
String key = pair.getKey(); //ключ
String value = pair.getValue();
if (city.equals(key))//значение
System.out.println(value);
}
}
}