import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner kb = new Scanner(System.in);
String sentence = kb.next().toUpperCase();
HashMap<Character, Integer> map = new HashMap<>();
List<Character> list = new ArrayList<>();
int max = 0;
for(char c: sentence.toCharArray()) {
map.put(c, map.getOrDefault(c, 0)+1);
max = Math.max(max, map.get(c));
}
for(Map.Entry<Character, Integer> entry: map.entrySet()) {
if(entry.getValue() == max) {
list.add(entry.getKey());
}
}
if(list.size()>1) {
System.out.println("?");
}else {
System.out.println(list.get(0));
}
}
}