package com.javarush.task.task08.task0829; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; 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 city, surname, citySearch; while(true) { city = reader.readLine(); surname = reader.readLine() ; family.put(city,surname); if(city.isEmpty()) {break;} } citySearch = reader.readLine(); for(Map.Entry<String, String> item: family.entrySet()) { if (item.getKey().equals(citySearch)) { System.out.println(item.getValue()); } } } }