-A:-write(A). f:- -'failed at: '. []+S:-S=[9]-> -yes;f,-'EOL'. [H|T]+[A|B]:-nth0(I,"({[<)}]>",H),(I<4->T+[I|[A|B]];(A+4=\=I->f,maplist(put,[H|T]);T+B)). m:-open('/dev/fd/0',read,F),repeat,read_line_to_codes(F,L),(L@