{$I-,Q-,R-,S-,D-,L-,O+}
{$I+,Q+,R+,S+,D+,L+,O-}
program H;
{$APPTYPE CONSOLE}
const
  inf = 'heapsort.in';
  ouf = 'heapsort.out';
  maxn = 50002;

type
  int = longint;

var
  a : array [0..maxn] of int;
  n, i, j, k : int;

begin
  assign(input, inf);
  reset(input);
  read(n);
  close(input);
  i := 2;
  j := n - 1;
  a[1] := n;
  a[n] := 1;
  for k := n - 1 downto 2 do
    if ((odd(k))and(not odd(n)))
    or ((not odd(k))and(odd(n)))
     then begin
      a[i] := k;
      inc(i)
    end else begin
      a[j] := k;
      dec(j);
    end;
  assign(output, ouf);
  rewrite(output);
  for i := 1 to n do write(a[i], ' ');
  close(output);
end.
