Counting in the order

아직 제출이 없습니다시간 제한1초메모리 제한512 MB

문제

During the whole year Vasya didn't go to the university, therefore he didn't pass his exams and was expelled. That's how he ended up in the army. And the most popular exercise in the army is standing in the order.

There're nn soldiers in Vasya's troop including himself. Soldiers are standing in a row, each of them is looking to the left or to the right and have his own serial number from 11 to nn equal to his place in the order. The height of the ii-th soldier is h_ih\_i. Vasya thinks that the soldier with number ii see the soldier with number jj if the following conditions are true:

  • soldier ii looks toward the soldier jj;
  • all soldiers standing between them are not taller than soldier jj.

For example, if there're 44 soldiers in the row with heights h_1=178h\_1 = 178, h_2=180h\_2 = 180, h_3=170h\_3 = 170, h_4=190h\_4 = 190 and all soldiers are looking to the left, then 22-nd soldier will see only the 11-st one, 33-rd --- only 22-nd one (because between him and first soldier there is higher second soldier), 44-th will see 22-nd and 33-rd soldier.

Because there is nothing to do in the order, Vasya wants to calculate how many soldiers see each of the soldiers.

입력

The first line of input contains number nn --- the number of soldiers in the row (1n1051 \le n \le 10^5).

The second line contains nn numbers h_1,h_2,,h_nh\_1, h\_2, \ldots, h\_n --- heights of soldiers in the row (1h_i1091 \le h\_i \le 10^9).

The third line contains nn symbols representing the directions in which the soldiers look: ii-th symbol is equal <<L>> if ii-th soldier looks to the left, i.e. potentially can see only the soldiers with serial numbers 1,2,,i11, 2, \ldots, i - 1, or <<R>> if ii-th soldier looks to the right and potentially can see only the soldier with serial numbers i+1,i+2,,ni + 1, i + 2, \ldots, n.

출력

Output nn integers, where ii-th integer is equal to the number of soldiers in the row that ii-th soldier see.