#include
#include
using namespace std;
char Frequency(string s)
{
long long int i,j;
long long int current_count;
long long int max_count=1;
char x;
for(i=0;i<s.length()-1;i++)
{
if(s[i]==β ')
i++;
char ch=s[i];
j=i+1;
while(j<s.length() && s[i]!='0')
{
current_count=1;
if(s[j]==' ')
j++;
if(ch==s[j])
{
current_count++;
s[j]='0';
s[i]='0';
}
j++;
}
if(current_count>max_count)
{
max_count=current_count;
x=ch;
}
}
return x;
}
int main() {
string s;
cin>>s;
cout<<Frequency(s);
return 0;
}