The -function
of a string
is defined as follows.
Given a string , sort its
suffixes into increasing lexicographically order of the
-function.
Formally, the task is to find a permutaion of
such that
holds for
.
The input consists of several test cases terminated by end-of-file.
The first line of each test case contains an integer n.
The second line contains a string.
*
*is either '`a`' or '`b`'.
* The sum of n does not exceed.
For each test case, print n integers which denote the result.
For s = aba,
*
*
*
Therefore,.