#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main(void)
{
string s;
cin >> s;
int max = 0;
int temp = 0;
bool flag = false;
int arr[26] = { 0, };
transform(s.begin(), s.end(), s.begin(), ::toupper); // 소문자화
for (int i = 0; i < s.length(); i++)
arr[int(s[i] - 65)] += 1;
for (int i = 0; i < 26; i++)
{
if (arr[i] > max)
{
max = arr[i];
temp = i;
}
}
for (int i = 0; i < 26; i++)
{
if ((max == arr[i]) and (i != temp))
flag = true;
}
if (flag)
std::cout << "?" << endl;
else
std::cout << char(temp+65) << endl;
return 0;
}