string = input().upper() word = list(set(string)) new = [] for i in word: cnt = string.count(i) new.append(cnt) if new.count(max(new)) >= 2: print("?") else: print(word[new.index(max(new))])