#include<stdio.h>#include<stdlib.h>struct Node{int e,n;Node *next;};int L;Node* A;int X;int main(){int e;Node* p,* q,* r;A=NULL;while(scanf("%d",&L)==1){scanf("%d",&e);A=(Node *)malloc(sizeof(Node));A->e=e;A->n=1;A->next=NULL;L--;while(L>0){p=A;scanf("%d",&e);while(p!=NULL){if(p->e==e){p->n++;break;}q=p;p=p->next;}if(p==NULL){r=(Node *)malloc(sizeof(Node));r->e=e;r->n=1;r->next=NULL;q->next=r;}L--;}int maxn=0;p=A;while(p!=NULL){if((p->n)>maxn){maxn=p->n;X=p->e; }p=p->next;}printf("%dn",X);p=A;while(p){q=p;p=p->next;free(q);}A=NULL; }return 0;}


