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]; for(int types_i=0; types_i < n; types_i++){ types[types_i] = in.nextInt(); } // your code goes here Map typeMap = new HashMap(); typeMap.put(1,0); typeMap.put(2,0); typeMap.put(3,0); typeMap.put(4,0); typeMap.put(5,0); for(int i = 0; i < n;i++){ int count = typeMap.get(types[i]); typeMap.put(types[i],count+1); } int maxValueInMap=(Collections.max(typeMap.values())); for(int key: typeMap.keySet()){ if(typeMap.get(key).equals(maxValueInMap)){ System.out.println(key); break; } } } }