#include #include #define N 10010 using namespace std; int a[N],n,i,x; int main() { while(scanf("%d",&n)!=EOF) { memset(a,0,sizeof(a)); for(i=1;i<=n;i++)scanf("%d",&x),a[x]++; for(i=1;i<10000;i++)if(a[i]>(n/2))break; if(i>=10000)puts("-1");else printf("%d\n",i); } }