program taskH;

{$APPTYPE CONSOLE}
const
  MaxN = 50001;
var
  fi,fo:TextFile;
  n, i1,b1,b2:Longint;
  A:array [1..MaxN] of longint;
begin
  AssignFile(fi,'heapsort.in');
  AssignFile(fo,'heapsort.out');
  Rewrite(fo);
  Reset(fi);
  ReadLn(fi,n);
  {
  A[1]:=N;
  for i1:= 1 to n do
  begin
    if 2*i1  <=n then a[2*i1]  :=a[i1]-1;
    if 2*i1+1<=n then a[2*i1+1]:=(a[i1] div 2) + (a[i1] mod 2);
  end;
  for i1:=1 to n-1 do
    Write(fo,A[i1],' ');
  Write(fo,'1');
  }

  a[1]:=1;
  for i1:=2 to n do
     begin
        a[i1-1]:=i1; b1:=i1-1;
        while (b1>1) do
           begin
              //swap
              b2:=a[b1]; a[b1]:=a[b1 div 2]; a[b1 div 2]:=b2;
              b1:=b1 div 2;
           end;
        //add 1
        a[i1]:=1;
     end;
  //output
  for i1:=1 to n do Write(fo,a[i1],' ');

  Close(fo);
  Close(fi);
end.
