#!/bin/python import sys n = int(raw_input().strip()) types = map(int, raw_input().strip().split(' ')) # your code goes here dict_birds = {} for type in types: if dict_birds.has_key(type): dict_birds[type] += 1 else: dict_birds[type] = 1 max_value = max(dict_birds, key=dict_birds.get) print max_value