import java.util.*; import java.lang.*; 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(); map.put(1,0); map.put(2,0); map.put(3,0); map.put(4,0); map.put(5,0); for(int types_i=0; types_i < n; types_i++){ types[types_i] = in.nextInt(); map.put(types[types_i],map.get(types[types_i])+1); } int max = Integer.MIN_VALUE; int result = 0; int maxValueInMap=(Collections.max(map.values())); for (Map.Entry entry : map.entrySet()) { if (entry.getValue()==maxValueInMap) { System.out.println(entry.getKey()); return; } } } }