import java.util.*;
import java.lang.*;
import java.io.*;
import java.io.*;
import java.util.stream.Collectors;
class Ideone
{
public static void main
(String[] args
) { Map
<String, String
> map
= new HashMap
<>(); map.put("Пупкин", "Василий");
map.put("Иванов", "Василий");
map.put("Пушкин", "Александр");
Map
<String, Integer
> counts
= new HashMap
<>(); map.entrySet().forEach(e -> counts.put(e.getValue(),
counts.getOrDefault(e.getValue(), 0) + 1));
Map
<String, String
> result
= map.
entrySet().
stream() .filter(entry -> counts.get(entry.getValue()) == 1)
}
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CmltcG9ydCBqYXZhLmlvLio7CmltcG9ydCBqYXZhLnV0aWwuc3RyZWFtLkNvbGxlY3RvcnM7CgpjbGFzcyBJZGVvbmUKewoJcHVibGljIHN0YXRpYyB2b2lkIG1haW4oU3RyaW5nW10gYXJncykgewogICAgICAgIE1hcDxTdHJpbmcsIFN0cmluZz4gbWFwID0gbmV3IEhhc2hNYXA8PigpOwogICAgICAgIG1hcC5wdXQoItCf0YPQv9C60LjQvSIsICLQktCw0YHQuNC70LjQuSIpOwogICAgICAgIG1hcC5wdXQoItCY0LLQsNC90L7QsiIsICLQktCw0YHQuNC70LjQuSIpOwogICAgICAgIG1hcC5wdXQoItCf0YPRiNC60LjQvSIsICLQkNC70LXQutGB0LDQvdC00YAiKTsKCiAgICAgICAgTWFwPFN0cmluZywgSW50ZWdlcj4gY291bnRzID0gbmV3IEhhc2hNYXA8PigpOwogICAgICAgIG1hcC5lbnRyeVNldCgpLmZvckVhY2goZSAtPiBjb3VudHMucHV0KGUuZ2V0VmFsdWUoKSwKICAgICAgICAgICAgICAgICAgICAgICAgY291bnRzLmdldE9yRGVmYXVsdChlLmdldFZhbHVlKCksIDApICsgMSkpOwogICAgICAgIE1hcDxTdHJpbmcsIFN0cmluZz4gcmVzdWx0ID0gbWFwLmVudHJ5U2V0KCkuc3RyZWFtKCkKICAgICAgICAgICAgICAgIC5maWx0ZXIoZW50cnkgLT4gY291bnRzLmdldChlbnRyeS5nZXRWYWx1ZSgpKSA9PSAxKQogICAgICAgICAgICAgICAgLmNvbGxlY3QoQ29sbGVjdG9ycy50b01hcChNYXAuRW50cnk6OmdldEtleSwgTWFwLkVudHJ5OjpnZXRWYWx1ZSkpOwogICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbihyZXN1bHQpOwogICAgfQp9