7571 - ><   

Description

A security system randomly generates a challenge sequence containing N-1
symbols s[1],s[2]…s[n-1] where s[i] is either '<' or '>'. You are required to find a
key sequence of N distinct integers(a[1],a[2],a[3]...a[N]) in the range from 1 to N,
and such that the inequality a[i] s[i] a[i+1] is satisfied for all i = 1,2,…,N-1. Please
remember that each integer from 1 to N must be used only once in the key
sequence.
For example, with the challenge sequence <<>< and the key sequence 1 2 4 3 5, all
inequalities are satisfied:
1 < 2 < 4 > 3 < 5
Your task is to write a program to find the key sequence mentioned above. If
there is more than one valid key sequence, you should select the smallest one in
lexicography order.

Input

The input file consists of several test cases. Each test case consists of two
lines where the first line contains number N (2<=N<=10^5). The second line
contains the challenge sequence of N-1 characters.

Output

For each data set, write in one line the corresponding space-separated key
sequence.

Sample Input  Download

Sample Output  Download

Tags




Discuss