program h;

{$APPTYPE CONSOLE}

{$DEFINE DEBetgfwUG}

uses
  SysUtils;

const
  TaskName = 'heapsort';


var
  i, j, k, n : Integer;
  a : array [ 1 .. 50000] of Integer;

procedure Solve();
  var
    i, j : Integer;
  begin
    a[1] := 1;
    for i := 2 to n do
      begin
        j := i - 1;
        while (j > 1) do
          begin
            a[j] := a[j div 2];
            j := j div 2;
          end;
        a[1] := i;
        a[i] := 1;
      end;
  end;

begin
{$IFNDEF DEBUG}
  Assign( input, TaskName + '.in' );
  Assign( output, TaskName + '.out' );
  Reset(input);
  Rewrite(output);
{$ENDIF}

  ReadLn(n);

  Solve();

  for i := 1 to n do
    write(a[i], ' ');

{$IFNDEF DEBUG}
  Close(input);
  Close(output);
{$ELSE}
  ReadLn;
{$ENDIF}
end.
