from collections import Counter, defaultdict def Base_10_to_n(X, n): X_dumy = X out = '' while X_dumy>0: out = str(X_dumy%n)+out X_dumy = int(X_dumy/n) return out def Base_n_to_10(X,n): out = 0 for i in range(1,len(str(X))+1): out += int(X[-i], 16)*(n**(i-1)) return out#int out s = input()[::-1] n = len(s) d = defaultdict(int) for i in range(0, n, 3): t = s[i * 3 : i * 3 + 3] num = Base_10_to_n(Base_n_to_10(t, 16), 8) for j in num: d[j] += 1 c = Counter(d).most_common() m = max(d.values()) ans = [] for i, v in c: if v == m: ans.append(i) else: break print(*sorted(ans))