Points: 1700 (p) Time limit: 1.0s Memory limit: 256M Input: stdin Output: stdout

Example

Sample input

6
3 2 6
LLR
2 -1 8
RL
4 -2 5
LRRR
5 3 7
LRRLL
1 1 1
L
3 -1 4846549234412827
RLR

Sample output

1 -2
4 1
1 -1
0 2
1 0
2423274617206414 0

Comments

There are no comments at the moment.