import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Arrays; import java.util.Comparator; import java.util.List; import java.util.Map; import java.util.function.Function; import java.util.stream.Collectors; public class Solution { public static void main(String argsp[]) throws Exception{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String readLine = br.readLine(); List list = Arrays.asList(br.readLine().split(" ")); Map map = list.stream() .collect(Collectors.groupingBy(Function.identity(),Collectors.counting())); long maxFrequency = map.values().stream().max(Comparator.naturalOrder()).get(); String minId = ""; int val =Integer.MAX_VALUE; for(Map.Entry e : map.entrySet()){ if(e.getValue()==maxFrequency){ if(e.getValue()