import java.util.*; 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 i=0; i < n; i++){ types[i] = in.nextInt(); map.put(types[i],map.get(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; } } } }