import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { private static int[] readBirdTypes() { 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(); } return types; } public static void main(String[] args) { int[] birdTypes = readBirdTypes(); int[] birdTypesCount = new int[5]; // Count birds of each type for (int i = 0; i < birdTypes.length; ++i) { ++birdTypesCount[birdTypes[i] - 1]; } // Compute index of most frequently occurring bird type int mostFrequentBirdType = 0; int mostFrequentBirdTypeCount = birdTypesCount[0]; for (int i = 1; i < 5; ++i) { if (birdTypesCount[i] > mostFrequentBirdTypeCount) { mostFrequentBirdTypeCount = birdTypesCount[i]; mostFrequentBirdType = i; } } System.out.println(mostFrequentBirdType + 1); } }