program ProblemH;

{$APPTYPE CONSOLE}

const MAXN = 100000;

var
    a: array[1..MAXN] of integer;
    u: array[1..MAXN] of byte;
    i, j, n, m : integer;

begin
    assign(input, 'heapsort.in');  reset(input);
    assign(output, 'heapsort.out');  rewrite(output);
    read(n);
    {
    if (n and 1 = 1) or (n <= 3) then begin
        for i := 1 to n do
            a[i] := n - i + 1
    end else begin
    }
        a[1] := n;
        a[n] := 1;
        j := n - 1;
        while (j > 1) do begin
            u[j] := 1;
            j := j shr 1
        end;
        m := n - 1;
        for j := 2 to n - 1 do
            if (u[j] = 1) then begin
                a[j] := m;
                dec(m);
            end;
        for j := 2 to n - 1 do
            if (u[j] = 0) then begin
                a[j] := m;
                dec(m)
            end;
    //end;
    for i := 1 to n do
        write(a[i], ' ')
end.
