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 s = new Scanner (System.in); int numBirds = s.nextInt(); int[] typeCount = new int[6]; for (int i = 0; i < numBirds; i++){ typeCount[s.nextInt()]++; } int max = 0; int idx = 1; for (int i = 1; i < typeCount.length;i++){ if (typeCount[i]>max){ max = typeCount[i]; idx = i; } } System.out.println(idx); } }