本题如果提交后显示“您的代码已保存 查询超时,请重试”,则可以稍后在提交记录页面看到结果。
If you receive "您的代码已保存 查询超时,请重试" after submitting, then you can see the result on the "submission status" page later.
Grammy has a string

of length

containing only lowercase letters.
For a string

, if we record the first occurrence of each type of character in order as

, then the minimal representation of

can be obtained by replacing all occurrence of

in

by the first character of the character set (
a), replacing all occurrence of

in

by the second character of the character set (
b), and so on.
For example, when the character set is lowercase, the minimal representation of “edcca” is “abccd”, and “xy” and “zt” are essentially the same in terms of minimal representation.
Your task is sorting all suffixes of

with a special regularity.
For two suffixes

and

, if the minimal representation of

is less than
the minimal representation of

in the lexicographic order, then

is less than

in the special regularity.
Please output the result array

of the suffix sort with the special regularity. The

-th element of

is the position of the first character in the i-th smallest suffix of

with the special regularity.