program taskh;
{$APPTYPE CONSOLE}
{$I+,Q+,R+,O-}
uses
  SysUtils,Math;

type
  short=smallint;
  long=longint;
  ex=extended;
  bool=boolean;

const
  maxn=60000;

var
  a:array[0..maxn]of long;
  top,i,n:long;

procedure add(x:long);
var j:long;
begin
  inc(top);
  if true then begin
    a[top]:=a[top-1];
    j:=top-1;
  end else begin
    j:=top;
  end;
  while (j>1)and(a[j div 2]<x)do begin
    a[j]:=a[j div 2];
    j:=j div 2;
  end;
  a[j]:=x;
end;

begin
  assign(input,'heapsort.in'); reset(input);
  assign(output,'heapsort.out'); rewrite(output);

  read(n);
  a[1]:=1;
  top:=1;
  for i:=2 to n do begin
    add(i);
  end;

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

  close(input);
  close(output);
end.
