var n, i, tmp: longint;
    f: boolean;
    tmps: string;
    a: array[1..10000] of string;
    b: array[1..10000] of longint;
begin
    reset(input, 'champ.in');
    rewrite(output, 'champ.out');
    readln(n);
    for i := 1 to n do
        begin
            readln(a[i]);
            b[i] := i;
        end;
    f := true;
    while (f) do
        begin
            f := false;
            for i := 1 to n - 1 do
                if ((a[i] + a[i + 1]) > (a[i + 1] + a[i])) then
                    begin
                       tmps := a[i]; a[i] := a[i + 1]; a[i + 1] := tmps;
                       tmp := b[i];  b[i] := b[i + 1]; b[i + 1] := tmp; 
                       f := true;
                    end;
        end;
    for i := 1 to n do
        writeln(b[i]);
end.