///@author Sycamore///@date 8/8/2017#includeusing namespace std;int main(){ ios::sync_with_stdio(false); cin.tie(0); int n; while (cin >> n) { map v; int t,ans=-1; for (int i = 1; i <=n; i++) { cin >> t; if(ans==-1) if (++v[t] >= ((n + 1) >> 1)) ans = t; } cout << ans << endl; } return 0;}