import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.Map.Entry; 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]; for(int types_i=0; types_i < n; types_i++){ types[types_i] = in.nextInt(); } // your code goes here System.out.println(maxCount(types)); } public static int maxCount( int[] a) { int max_g=0;int key=0; HashMap map = new HashMap(); for(Integer i:a) { if(map.containsKey(i)) { int freq=map.get(i); freq++; map.put(i, freq); } else { map.put(i, 1); } } for(Entry e:map.entrySet()) { int max=0; max=e.getValue(); if(max>max_g) { max_g=max; key=e.getKey(); } else if(max==max_g) { key=(key