m:-get(N),M is N-49,numlist(0,M,R),!,R-Q-0-[]-[],concat_atom(Q,' ',U),\+writeln(U). A/B:-member(A,B). []-[]-_-_-_. Q-[Y|S]-X-E-F:-Y/Q,delete(Q,Y,R),C is X-Y,\+C/E,D is X+Y,\+D/F,Z is X+1,R-S-Z-[C|E]-[D|F].

Note that non-ascii characters in the above source code will be escaped (such as \x9f).