• + 0 comments
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    HashMap<String, String> phoneBook = new HashMap<>();
    try {
        int n = Integer.parseInt(in.readLine());
        while (n-- > 0) phoneBook.put(in.readLine(), in.readLine());
        String key;
        while ((key = in.readLine()) != null) {
            if (phoneBook.containsKey(key)) {
                System.out.println(key + "=" + phoneBook.get(key));
            } else {
                System.out.println("Not found");
            }
        }
        in.close();
    } catch (Exception e) {
        System.out.println(e);
    }