program Project1;

var
  n, v : Integer;
  a : array [1..50000] of Integer;
  l, r : Integer;

begin
  AssignFile(Input, 'heapsort.in');
  Reset(Input);
  Read(n);
  CloseFile(Input);

  a[n] := 1;
  l := 1; r := n - 1;
  v := n;
  while v >= 2 do
  begin
    a[l] := v; Inc(l); Dec(v);
    if v = 1 then Break;
    a[l] := v; Inc(l); Dec(v);
    if v = 1 then Break;
    a[r] := v; Dec(r); Dec(v);
    if v = 1 then Break;
  end;

  AssignFile(Output, 'heapsort.out');
  Rewrite(Output);
  for v := 1 to n do
    Write(a[v], ' ');

  CloseFile(Output);
end.
