#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,i,j,ant=0,cnt;
string s,str;
for(i=0;i<n;i++)
{
cnt=0;
for(j=i;j<n;j++)
{
if(s[j]==s[i]&&s[j+1]==s[i+1])
cnt++;
}
if(cnt>ant)
{
ant=cnt;
str.clear();
str.push_back(s[i]);
str.push_back(s[i+1]);
}
}
cout<<str<<endl;
return 0;
}