#!/bin/python import sys n = int(raw_input().strip()) types = map(int, raw_input().strip().split(' ')) # your code goes here count=dict() max=0 for type in types: count[type]=count.get(type,0)+1 for (key,value) in count.items(): if value>max: t=key max=value print t