类似求众数
#include <iostream>
#include <algorithm>
using namespace std;
const int N = 1010;
int cnt[N];
int main(){
string str;
cin>>str;
int max_cnt = -1;
for (int i = 0;i<str.size();i++){
cnt[str[i]]++;
max_cnt=max(max_cnt,cnt[str[i]]);
}
sort(str.begin(),str.end());
for (int i = 0;i<str.size();i++){
if (cnt[str[i]] == max_cnt){
cout<<str[i]<<endl;
break;
}
}
cout<<max_cnt<<endl;
return 0;
}