#include<iostream>
#include<algorithm>
using namespace std;
int i,n,j,p,w,a[1000000],ans[1000000];
int main()
{
while(scanf("%d",&n)!=EOF)
{
p=(n+1)/2;
memset(ans,0,sizeof(ans));
for(j=0;j<n;j++)
scanf("%d",&a[j]);
for(i=0;i<n;i++)
{
ans[a[i]]++;
if(ans[a[i]]>=p)
{
printf("%d\n",a[i]);
break;
}
}
}
return 0;
}