# include <bits/stdc++.h>
# define maxn 100001
# define ll long long
# define clock (clock() * 1000.0 / CLOCKS_PER_SEC)
# define rc(s) return cout << s,0
# define _ ios_base::sync_with_stdio(false);cin.tie(0);cerr.tie(0);cout.tie(0);
# define pb push_back
# define mp make_pair
//# define int ll
using namespace std;
const int inf = INT_MAX;
map<int,int>a;
int mj;
int32_t main(){_
freopen("elmaj.in","r",stdin);
freopen("elmaj.out","w",stdout);
int n;
cin >> n;
for(int i = 1;i<=n;i++)
{
int x;
cin >> x;
a[x]++;
if(!mj && a[x] >= (n/2) + 1) mj = x;
}
if(mj) rc(mj << ' ' << a[mj]);
rc(-1);
}