Что не так ?
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> map = new HashMap<>();
while (true) {
String sity = reader.readLine();
String famali = reader.readLine();
if (sity.isEmpty()){
break;
}
map.put(sity, famali);
}
String search = reader.readLine();
for (Map.Entry<String, String> entry : map.entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
if (key.equals(search)) {
System.out.println(value);
}
}
}
}