N = input() L = map(int, raw_input().split()) cnt = [[0,i] for i in range(6)] for el in L: cnt[el-1][0] += 1 cnt.sort() print cnt[-1][1]+1