#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
typedef long long LL;
typedef struct Treenode
{
LL str;
int cnt;
struct Treenode* left;
struct Treenode* right;
}Treenode,*Tree;
Tree Newnode(LL s)
{
Tree t = (Tree)malloc(sizeof(Treenode));
t->str = s;
t->cnt = 1;
t->left = NULL;
t->right = NULL;
return t;
}
Tree Insert(Tree T,LL s)
{
if(!T)
T = Newnode(s);
else if(T->str>s)
T->left = Insert(T->left,s);
else if(T->str<s)
T->right = Insert(T->right,s);
else
T->cnt = T->cnt+1;
return T;
}
void find(Tree T,LL &mins,int &maxt,int &same)
{
if(T)
{
if(T->cnt > maxt)
{
maxt = T->cnt;
mins = T->str;
same = 1;
}
else if((T->cnt==maxt))
{
if(T->str<mins)
mins = T->str;
same++;
}
find(T->left,mins,maxt,same);
find(T->right,mins,maxt,same);
}
}
int main()
{
int n;
LL t1;
Tree T;
cin>>n;
cin>>t1;
T =Newnode(t1);
for(int i=1;i<2*n;i++)
{
cin>>t1;
T = Insert(T,t1);
}
LL ms=0;
int mt=0,num=0;
find(T,ms,mt,num);
cout<<ms<<‘ ‘<<mt;
if(num>1)
cout<<‘ ‘<<num<<endl;
else
cout<<endl;
return 0;
}