from functools import reduce
from itertools import zip_longest

def grouper(iterable, n, fillvalue=None):
    "Collect data into fixed-length chunks or blocks"
    # grouper('ABCDEFG', 3, 'x') --> ABC DEF Gxx"
    args = [iter(iterable)] * n
    return zip_longest(*args, fillvalue=fillvalue)


import ast, sys

for bits in map(ast.literal_eval, sys.stdin):
    bytes = [reduce(lambda byte, bit: byte << 1 | bit, eight_bits)
             for eight_bits in grouper(bits, 8, fillvalue=0)]
    print("{bits} -> {bytes}".format(**vars()))