{$APPTYPE CONSOLE}
program heapsort;

const
        st1='heapsort.in';
        st2='heapsort.out';
var
        a:array[1..50000] of longint;
        count,i,j,x,n:longint;
{******************}
procedure look;
begin
        assign(input,st1); reset(input);
        assign(output,st2); rewrite(output);

        readln(n);
        i:=1;
        j:=n;
        a[i]:=n;
        a[j]:=1;
        count:=n-1;
end;
{******************}
procedure action;
begin
        repeat
                inc(i);
                dec(j);
                a[i]:=count;
                dec(count);
                if a[j]=0 then begin a[j]:=count; dec(count); end;
        until (i=j)or(j-i=1);
end;
{******************}
procedure finish;
begin
        for x:=1 to n do
        write(a[x],' ');
        close(input); close(output);
end;
{******************}
begin
        look;
        action;
        finish;
end.
