1 #include <iostream>
2 #include <cstdlib>
3 #include <cstdio>
4 #include <algorithm>
5 #include <vector>
6 #include <queue>
7 #include <cmath>
8 #include <stack>
9 #include <cstring>
10
11 using namespace std;
12
13 #define INF 0xfffffff
14 #define maxn 10005
15
16 int main()
17 {
18 int n, x, i, k;
19 int cnt[maxn];
20
21 while(scanf("%d", &n) != EOF)
22 {
23 memset(cnt, 0, sizeof(cnt));
24 k = -1;
25 for(i = 1; i <= n; i++)
26 {
27 scanf("%d", &x);
28 cnt[x]++;
29 }
30
31 for(i = 0; i<= 10000; i++)
32 {
33 if(cnt[i] > n/2)
34 {
35 k = i;
36 break;
37 }
38 }
39 printf("%d\n", k);
40 }
41 return 0;
42 }