import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int[] level = new int[7]; for(int i = 0; i < N; i++) { level[sc.nextInt()]++; } int max = 0; for(int i = 0; i < 7; i++) { max = Math.max(max, level[i]); } int ans = 0; for(int i = 6; i >= 0; i--) { if(level[i] == max) { ans = i; break; } } System.out.println(ans); } }