([rec'x(map write x)(print)'(map(.$ abs -)x(cdr x))](map digit->integer(string->list(read-line))))