local s = io.read() local t = {} local f = {"1010", "1011", "1100", "1101", "1110", "1111"} local n = #s for i = 1, n do local v = s:byte(i) - 64 table.insert(t, f[v]) end s = table.concat(t) n = #s f = {"000", "001", "010", "011", "100", "101", "110", "111"} local g = {} for i = 1, 8 do g[i] = 0 end for i = n, 1, -3 do local left = math.max(1, i - 2) local v = s:sub(left, i) if #v == 1 then v = "0" .. v end if #v == 2 then v = "0" .. v end for j = 1, 8 do if f[j] == v then g[j] = g[j] + 1 break end end end local ret = {} for i = 1, 8 do local f = true for j = 1, 8 do if g[i] < g[j] then f = false end end if f then table.insert(ret, i - 1) end end -- print(table.concat(g, " ")) print(table.concat(ret, " "))