I don't know what's wrong with my code input and output are alright but compiler doesn't want accept that?
package pl.codegym.task.task08.task0829;
import jdk.nashorn.internal.runtime.regexp.joni.ScanEnvironment;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
/*
Aktualizacja oprogramowania
*/
public class Solution {
public static void main(String[] args) throws IOException {
Scanner input = new Scanner(System.in);
Map<String, String> familys = new HashMap<>(3);
for (int i = 0; i < 3; i++) {
String city = input.nextLine();
String family = input.nextLine();
familys.put(city, family);
}
input.nextLine();
String find = input.nextLine();
Iterator<Map.Entry<String, String>> iterator = familys.entrySet().iterator();
while (iterator.hasNext()){
Map.Entry<String, String> next = iterator.next();
String key = next.getKey();
String value = next.getValue();
if(key.equals(find))
System.out.println(value);
}
}
}