杭电1029
/*********************************
* 日期:2011-3-9
* 作者:SJF
* 题号:杭电1029
* 题目:Ignatius and the Princess IV
* 结果:AC
* 总结:
**********************************/
#include<stdio.h>
__int64 count[1000000],flag[1000000];
int main()
{
int N;
while(scanf("%d",&N)!=EOF)
{
__int64 i,number;
memset(count,0,sizeof(count));
memset(flag,0,sizeof(flag));
for(i=0;i<N;i++)
{
scanf("%I64d",&number);
count[number]++;
if(count[number]>=(N+1)/2)
{
if(flag[number]==0)
{
printf("%d\n",number);
flag[number]=1;
}
}
}
}
return 0;
}