#!/bin/python3 import sys from collections import Counter n = int(input().strip()) types = list(map(int, input().strip().split(' '))) def get_max_type(types): ''' Returns type with greatest count ''' c = Counter(types) return max(c, key=c.get) print(get_max_type(types))