program h;

{$APPTYPE CONSOLE}

uses
  SysUtils;
var
  x:array[1..50000] of longint;
  n:longint;
  i,cur:longint;

begin
       assignFile(input,'heapsort.in'); Reset(input);
       assignFile(output,'heapsort.out'); Rewrite(output);

  { TODO -oUser -cConsole Main : Insert code here }

        readln(n);
        if n>1 then
        begin
        x[1]:=2;x[2]:=1;
        for i:=3 to n do
                begin
                        cur:=i-1;
                        while cur > 1 do
                        begin
                        x[cur]:=x[cur div 2];
                        cur:=cur div 2;
                        end;
                        x[i]:=1;
                        x[1]:=i;
                end;
        for i:=1 to n do
                write(x[i],' ');
        end
        else
        write('1');
        close(input);close(output);
end.
