(defun f(p q r i n)(if(< i n)(dotimes(x n)(or(find(+ i x)p)(find(- i x)q)(find x r)(f(cons(+ i x)p)(cons(- i x)q)`(,@r,x)(1+ i)n)))(format t"~{~D~^ ~} "r)))(f()()()0(read))