mod = 1000000007 eps = 10**-9 def main(): import sys input = sys.stdin.readline N = input().rstrip('\n') cnt = [0] * 8 for n in N: cnt[1] += 1 if n == "A": cnt[2] += 1 elif n == "B": cnt[3] += 1 elif n == "C": cnt[4] += 1 elif n == "D": cnt[5] += 1 elif n == "E": cnt[6] += 1 else: cnt[7] += 1 ma = -1 I = [] for x in range(8): if cnt[x] > ma: ma = cnt[x] I = [x] elif cnt[x] == ma: I.append(x) print(*I) if __name__ == '__main__': main()