import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {
	public static void main(String[] args) throws IOException {
		int[] alphabet = new int[26];
		Arrays.fill(alphabet, 0);

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str = br.readLine().toLowerCase();
		char[] ch = str.toCharArray();
		int len = ch.length;

		int max = 0;
		for (int i = 0; i < len; i++) {
			int findIndex = ch[i] - 'a';
			alphabet[findIndex]++;
			if (max < alphabet[findIndex]) {
				max = alphabet[findIndex];
			}
		}
		
		String answer = "";
		for(int i=0;i<26;i++) {
			if(alphabet[i]==max) {
				answer+=(char)('a'+i);
			}
		}

		if(answer.length()>1) {
			System.out.println("?");
		}else if(answer.length()==1) {
			System.out.println(answer.toUpperCase());
		}
		
	}

}