countdown(1) :- write(1), !.
countdown(N) :-
write(N), nl,
M is N - 1,
write(M).