{v$O-,I+,S+,R+,Q+,H-}

{$A+,B-,C+,D+,E-,F-,G+,H+,I+,J-,K-,L+,M-,N+,O+,P+,Q-,R-,S-,T-,U-,V+,W-,X+,Y+,Z1}

const
  cinfile = 'heapsort.in';
  coutfile = 'heapsort.out';
  inf = maxlongint shr 1;
  eps = 1E-8;

  nmax = 55000;

type
  int = longint;
  real = extended;
  float = extended;

var
  n, k, m : int;
  ans : int;

  a : array [1..nmax] of int;

procedure outdata;
var
  i, j : int;
begin
  for i:= 1 to n - 1 do write(a[i],' ');
  writeln(a[n]);
end;

procedure siftup(no : int);
var
  i, x : int;
begin
  i:= no;
  while i > 1 do
  begin
    x:= a[i];
    a[i]:= a[i shr 1];
    a[i shr 1]:= x;
    i:= i shr 1;
  end;
end;

procedure solve;
var
  i, j : int;
begin
  for i:= 1 to n do a[i]:= i;
  if n = 1 then exit;
  a[1]:= 2;
  a[2]:= 1;
  for i:= 3 to n do
  begin
    siftup(i-1);
    a[1]:= i;
    a[i]:= 1;
  end;
end;

procedure readdata;
var
  i, j : int;
begin
  read(n);
end;

begin
  reset(input, cinfile);
  rewrite(output, coutfile);
  readdata;
  solve;
  outdata;
  close(output);
  close(input);
end.
