import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int[] types = new int[n]; HashMap map = new HashMap (); for(int types_i=0; types_i < n; types_i++){ types[types_i] = in.nextInt(); if(map.containsKey(types[types_i])) { map.put(types[types_i],map.get(types[types_i])+1); } else { map.put(types[types_i],1); } } // your code goes here int high = 0,k=0; for(Map.Entry m:map.entrySet()) { //System.out.println(m.getKey()+"-"+m.getValue()); if(m.getValue()>high) { k=m.getKey(); high=m.getValue(); } else if(m.getValue()==high) { if(m.getKey()