import java.util.Scanner; public class RookieRank2_1 { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int[] set = new int[n]; int[] flag = new int[6]; for (int i = 0; i < set.length; i++) { set[i] = scan.nextInt(); flag[set[i]]++; } int max = 0; int index = 0; for (int i = 0; i < flag.length; i++) { if (flag[i] > max) { max = flag[i]; index = i; } } System.out.println(index); } }