import sequtils, strutils, unicode var n = readLine stdin n = n.reversed var s = "" while n.len > 3: var h = n[0 .. 2] h = h.reversed s.add h.parseHexInt.toOct 4 n = n[3 .. ^1] n = n.reversed s.add n.parseHexInt.toOct 4 var cnt: array[10, int] for v in s: cnt[parseInt $v].inc let maxV = max cnt var ans: seq[int] for i in 0 .. 9: if cnt[i] == maxV: ans.add i echo ans.join " "