import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.IOException;
public class Main
{
public static void main(String[] args) throws IOException
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int[] arr = new int[26];
String word = br.readLine();
for(int i = 0 ; i < word.length(); i++)
{
if(word.charAt(i) >= 65 && word.charAt(i) <= 90)
arr[word.charAt(i) - 65]++;
else
arr[word.charAt(i) - 97]++;
}
int max = -1;
char ch = '?';
for(int i = 0; i < 26; i++)
{
if(arr[i] > max)
{
max = arr[i];
ch = (char)(i + 65);
}
else if(arr[i] == max)
{
ch = '?';
}
}
System.out.print(ch);
}
}
어려워서 찾아보면서 했다.