import java.io.*;
import java.util.Arrays;

public class Main{
    public static void main(String[] args) throws IOException
    {
    	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    	
    	String str = br.readLine();
    	int chars[] = new int[str.length()];
    	int index = 0;
    	int max = Integer.MIN_VALUE;
    	
    	str =str.toUpperCase();
    	
    	for(int i=0; i<str.length(); i++)
    	{
    		chars[i]=str.charAt(i);
    	}
    	
    	chars =Arrays.stream(chars).distinct().toArray();
    	
    	int count[] = new int[chars.length];
    	
    	for(int i=0; i<chars.length; i++)
    	{
    		for(int j =0; j<str.length(); j++)
    		{
    			if(chars[i] == str.charAt(j)) 
    			{
    				count[i]++;
    			}
    		}
    	}
 
    	for(int i=0; i<count.length; i++)
    	{
    		if(max < count[i]) 
    			{
    				index = i;
    				max = count[i];
    			
    			}
    		else if(max == count[i])
    		{
    			max = Integer.MIN_VALUE;
    			break;
    		}
    	}
    	
    	if(max == Integer.MIN_VALUE) System.out.println('?');
    	else System.out.println((char)chars[index]);
    	
    }
}