#!/bin/python3 import sys n = int(input().strip()) types = list(map(int, input().strip().split(' '))) # your code goes here commonBirds = [0, 0, 0, 0, 0, 0] for i in types: commonBirds[i] = commonBirds[i] + 1; common_bird_size = max(commonBirds) common_bird_type = 7 for j in range(len(commonBirds)): if (commonBirds[j] == common_bird_size and j < common_bird_type): common_bird_type = j print(common_bird_type)