import java.util.Scanner;import java.util.Set;import java.util.TreeMap; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); if (scanner.hasNext()) { Integer integer = Integer.valueOf(scanner.nextLine()); TreeMap<Integer,Integer> treeMap = new...