writelist([]) :- write('[]'),nl.
writelist([H|T]) :- write('['),writeseq([H|T]),write(']'),nl.
writeseq([H]) :- write(H),!.
writeseq([H|T]) :- write(H),write(','),writeseq(T).

writelist1([]).
writelist1([H|T]) :- write(H), nl, writelist1(T).
