А что тут уже не так ?
Считывает и работает :)
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 family = reader.readLine();
if (family.isEmpty()) {
break;
}
String town = reader.readLine();
if (town.isEmpty()){
break;
}
map.put(family, town);
}
// Read the house number
String city = reader.readLine();
Iterator<Map.Entry<String, String>> iterator = map.entrySet().iterator();
while(iterator.hasNext()){
Map.Entry<String, String> x = iterator.next();
if(city.equals(x.getValue())){
System.out.println(x.getKey());
break;
}
}
}
}