#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
	int n,num[110]={},x,ans1=0,ans2=0;
	cin >> n;
	for(int i=0;i<n;i++){
		cin >> x;
		num[x]++;
	}
	for(int i=1;i<=100;i++){
		if(num[i]>ans2){
			ans1 = i;
			ans2 = num[i];
		}
	}
	cout << ans1 << endl;
	return 0;
}
