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); final int n = in.nextInt(); final int[] types = new int[n]; for (int types_i = 0; types_i < n; types_i++) { types[types_i] = in.nextInt(); } final int maxType = getMaxType(types); System.out.println(maxType); } private static int getMaxType(int[] types) { final int typeKinds = 5; final int[] typeFreq = new int[typeKinds + 1]; for (int type : types) { typeFreq[type]++; } int maxType = -1; int maxTypeValue = -1; for (int i = 1; i <= typeKinds; i++) { if (typeFreq[i] > maxTypeValue) { maxTypeValue = typeFreq[i]; maxType = i; } } return maxType; } }