program ideone;
Const smax = 99;
Type simple = array[0..smax] of smallint;
Var data, res:simple; i, n:smallint;
procedure writeArr(arr:simple);
Var i:smallint;
begin
for i:=0 to n-1 do write(arr[i], ' ');
writeln();
end;
function isSame(arr:simple; num:smallint):boolean;
Var i:smallint;
begin
i:=0;
while (i<n) and (arr[i]<>num) do i:=i+1;
if i=n then isSame:=False else isSame:=True;
end;
function converter(data:simple):simple;
Var i, j, index, max:smallint; res:simple;
begin
for i:=0 to n-1 do res[i]:=0;
for i:=0 to n-1 do begin
max:=-1;
for j:=0 to n-1 do
if (data[j]>=max) and (isSame(res, j+1)=False) then begin
index:=j; max:=data[j]; end;
res[i]:=index+1;
end;
converter:=res;
end;
begin
read(n);
for i:=0 to n-1 do read(data[i]);
writeArr(converter(data));
end.
cHJvZ3JhbSBpZGVvbmU7CgpDb25zdCBzbWF4ID0gOTk7ClR5cGUgc2ltcGxlID0gYXJyYXlbMC4uc21heF0gb2Ygc21hbGxpbnQ7ClZhciBkYXRhLCByZXM6c2ltcGxlOyBpLCBuOnNtYWxsaW50OwoKcHJvY2VkdXJlIHdyaXRlQXJyKGFycjpzaW1wbGUpOwpWYXIgaTpzbWFsbGludDsKYmVnaW4KCWZvciBpOj0wIHRvIG4tMSBkbyB3cml0ZShhcnJbaV0sICcgJyk7Cgl3cml0ZWxuKCk7CmVuZDsKCmZ1bmN0aW9uIGlzU2FtZShhcnI6c2ltcGxlOyBudW06c21hbGxpbnQpOmJvb2xlYW47ClZhciBpOnNtYWxsaW50OwpiZWdpbgoJaTo9MDsKCXdoaWxlIChpPG4pIGFuZCAoYXJyW2ldPD5udW0pIGRvIGk6PWkrMTsKCWlmIGk9biB0aGVuIGlzU2FtZTo9RmFsc2UgZWxzZSBpc1NhbWU6PVRydWU7CmVuZDsKCmZ1bmN0aW9uIGNvbnZlcnRlcihkYXRhOnNpbXBsZSk6c2ltcGxlOwpWYXIgaSwgaiwgaW5kZXgsIG1heDpzbWFsbGludDsgcmVzOnNpbXBsZTsKY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