#include<bits/stdc++.h>
using namespace std;
int n;
int ans(int u)
{
    unordered_map<int,int>hash;
    while(u--)
    {
        int x;
        cin>>x;
        hash[x]++;
        if(hash[x]>n/2) return x;
    }
    return -1;
}
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0),cout.tie(0);
    cin>>n;
    cout<<ans(n);
    return 0;
}