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]; int[] count = new int[5]; int greatest = 0; int greatestJ = 0; for(int types_i=0; types_i < n; types_i++){ types[types_i] = in.nextInt(); } for(int i = 0; i < n; i++) { if(types[i] == 1) { count[0]++; } if(types[i] == 2) { count[1]++; } if(types[i] == 3) { count[2]++; } if(types[i] == 4) { count[3]++; } if(types[i] == 5) { count[4]++; } } greatest = count[0]; for(int j = 0; j < 5; j++) { if(count[j] > greatest) { greatest = count[j]; greatestJ = j + 1; } if(count[j] == greatest && j < greatestJ) { greatestJ = j + 1; } } System.out.println(greatestJ); } }