import sys
import fileinput

assembly = [str.strip(line) for line in fileinput.input()]

onebyte = set(("iadd isub imul idiv irem ineg inewa ipop ine ieq ilt ile igt ige i2f ireturn iload_0 iload_1 iload_2 iload_3 iloadc_0 iloadc_1 iloadc_m1 " +
           "fadd fsub fmul fdiv fneg bnot badd bmul fne feq flt fle fgt fge bne beq isr isrl isrg freturn breturn return fload_0 fload_1 fload_2 " +
           "fload_3 bload_0 bload_1 bload_2 bload_3 aload_0 aload_1 aload_2 aload_3 floadc_0 bloadc_t floadc_1 bloadc_f fnewa bnewa iloada floada bloada " +
           "istorea fstorea bstorea f2i fpop bpop").split())

twobyte = set("iinc_1 idec_1 isrn esr iload fload bload aload istore fstore bstore astore".split())

threebyte = set(("jsre jump branch_t branch_f iloadn floadn bloadn aloadn iloadg floadg bloadg aloadg iloade floade bloade aloade iloadc floadc bloadc " +
             "istoren fstoren bstoren istoreg fstoreg astoreg bstoreg istoree fstoree bstoree astoree").split())

fourbyte = set("iinc idec jsr".split())

assert (onebyte & twobyte == set())
assert (onebyte & threebyte == set())
assert (onebyte & fourbyte == set())
assert (twobyte & threebyte == set())
assert (twobyte & fourbyte == set())
assert (threebyte & fourbyte == set())

offset_ctr = 1

for line in assembly:
    if line.startswith('.') or line.endswith(':') or line == '':
        print(line)
        continue

    inst, *rest = line.split()

    print(f"    {inst} {' '.join(rest)}\t; offset: {offset_ctr} bytes")

    if inst in onebyte:
        offset_ctr += 1
    elif inst in twobyte:
        offset_ctr += 2
    elif inst in threebyte:
        offset_ctr += 3
    elif inst in fourbyte:
        offset_ctr += 4
    else:
        raise ValueError(f"Invalid instruction {inst} found?")
