IN G ; N
IN H ; Q
MOV G 1
SUB H G
IN F ; T
IN A ; L
IN B ; R
CMP F G
JZ 19
IN E
MOV D A
LOAD D C
ADD C E
STORE D C
ADD D G
CMP D B
JNZ 13
JZ 28
MOV D A
CMP F G
MOV C RES
LOAD D E
ADD C E
ADD D G
CMP D B
JNZ 22
OUT C
MOV E 0
CMP H E
JNZ 4
RETURN
