program h;

{$APPTYPE CONSOLE}

var
  k,cyc1,i,n,tm1:longint;
  a:array[1..60000] of longint;
begin
  Assign(Input, 'heapsort.in');
  Reset(Input);
  Assign(Output, 'heapsort.out');
  Rewrite(Output);
  readln(n);
  a[1]:=1;
  for i:=2 to n do
	begin
	  k:=i-1;
	  while (k>=2) do
		begin
		  a[k]:=a[k div 2];
		  k:=k div 2;
		end;
	  a[1]:=i;
	  a[i]:=1;
	end;
  for cyc1:=1 to n do
	write(a[cyc1], ' ');
	close(input);
	close(output);
end.
