import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        
        String s = in.next();
        s = s.toUpperCase(); 
        
        int[] count = new int[26];
        
        for(int i = 0; i < s.length(); i++){
            int a = s.charAt(i);
            count[a-65]++;
        }
        
        int max = count[0];
        int idx = 0;
        
        for(int i = 1; i < 26; i++){
            if(count[i] > max){
                max = count[i];
                idx = i;
            } 
        }
        
        int resultCount = 0;
        
        for(int i = 1; i < 26; i++){
            if(max == count[i])resultCount++;   
        }
        
        if(resultCount > 1){
            System.out.println("?");
        }else{
            System.out.println((char)(idx + 65));
        }   
    }
}