while (!(isempty (output))) do begin print pop(output); print " "; end;