There are
The catch? The sequence of turn directions (left or right) has already been decided, in a string of length L
, then the locations of the R
, they must form a clockwise angle.
Input
The first line of input contains a single integer
Each of the next
The next and final line contains a single string with exactly L
and R
, representing the sequence of turn directions.
It is guaranteed that no three obstacles will be collinear.
Output
If no solution is possible, print, on a single line, the integer -1
. Otherwise, print, on a single line, any permutation of the obstacles that satisfies the requirements. The permutation should be given as
If there are multiple possible solutions, print any of them.
Sample Input
4
2 2
2 1
1 2
1 1
LR
Sample Output
1 3 2 4
Comments