program ProblemH;

{$APPTYPE CONSOLE}

const MAXN = 100000;

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

begin
    assign(input, 'heapsort.in');  reset(input);
    assign(output, 'heapsort.out');  rewrite(output);
    read(n);
    if (n and 1 = 1) then begin
        for i := 1 to n do
            a[i] := n - i + 1
    end else begin
        for i := 1 to n - 1 do
            a[i] := n - i;
        a[n] := n; 
        j := n;
        while (j > 1) do begin
            if (a[j shr 1] < a[j]) then begin
                t := a[j shr 1];
                a[j shr 1] := a[j];
                a[j] := t;
            end
            else
                break;
            j := j shr 1
        end
    end;
    for i := 1 to n do
        write(a[i], ' ')
end.
