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(); if ((n <= 5) || (n >= 200000)) { throw new IllegalArgumentException("value is out of range"); } int[] types = new int[n]; for (int types_i = 0; types_i < n; types_i++) { types[types_i] = in.nextInt(); if ((types[types_i] < 1) || (types[types_i] > 5)) { throw new IllegalArgumentException("value is out of range"); } } Solution solution = new Solution(); int count[] = solution.getCount(types); int index = solution.getHighest(count); System.out.println(index + 1); } public int[] getCount(int[] types) { int count[] = {0, 0, 0, 0, 0}; for (int i = 0; i < types.length; i++) { switch (types[i]) { case 1: count[0]++; break; case 2: count[1]++; break; case 3: count[2]++; break; case 4: count[3]++; break; case 5: count[4]++; break; } } return count; } public int getHighest(int[] count) { int max = count[0]; int index = 0; for (int i = 0; i < count.length; i++) { if (max < count[i]) { max = count[i]; index = i; } } return index; } }