#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main() {
string s;
while(getline(cin,s))
{
map<char,int>mp;
for(int i = 0;i<s.size();i++)
{
if(isalpha(s[i]))
{
mp[tolower(s[i])]++;
}
}
int cnt = 0;
char c;
for(int i = 0;i<26;i++)
{
if(mp.count('a'+i) && mp['a'+i]>cnt)
{
cnt = mp['a'+i];
c = 'a'+i;
}
}
cout<<c<<" "<<cnt<<endl;
}
return 0;
}
/*
* This is a simple TEST. There ARE numbers and other symbols 1&2&3...........
*/