{$apptype console}
{ $q+,r+,o-}
{$q+,r+,o+}
{ $q-,r-,o+}

uses
  math, sysutils;

type
  int = longint;
  bool = boolean;
  float = extended;

const
  fn = 'heapsort';
  maxh = 60000;

var
  h: array[1..maxh] of integer;
  hsize: integer;
  n: integer;

procedure up( x: integer );
var
  t, p: integer;
begin
  t := h[x];
  while ( x > 1 ) do begin
    p := x div 2;
    if ( h[p] >= t ) then break;
    h[x] := h[p];
    x := p;
  end;
  h[x] := t;
end;

procedure solve;
var
  i: integer;
begin
  read( n );

  hsize := 1;
  h[1] := 1;
  for i := 2 to n do begin
    inc( hsize );
    h[hsize]   := 1;
    h[hsize-1] := i;
    up( hsize - 1 ); 
  end;

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

begin
  reset(input, fn + '.in');
  rewrite(output, fn + '.out');

  solve;
end.
