Mirko created a new robot and decided to test it on a giant test track. We can imagine the test track as 2D coordinate system. The robot starts at a point and receives a set of instructions denoted by letters , , , , each of them marking a direction in which robot should be moving.
More precisely, if a robot is located in , S
(north) means it should move to , J
(south)
means it should move to , I
(east) means it should move to and Z
(west) means it
should move to .
While robot is receiving instructions and moves through the test track, Mirko is verifying its position in the following manner. Test track contains fixed control points. After each instruction is made, each of the control points measures Manhattan-distance to the robot. Distances from all control points are then summed and sent to Mirko.
Assuming that robot moves by the instructions without error, calculate the sum of distances to all control points after each instruction.
Remark: Manhattan-distance of the points and is equal to .
Input Specification
First line of input contains positive integers (number of control points, ) and (number of instructions, ), separated by a single space.
Each of the following lines contains coordinates of one control point: two space-separated integers , with absolute value less than (million). It is possible that two control points have the same coordinates - distance towards each of them is added to the sum.
The following line contains a string of characters from the set , the sequence of instructions sent to the robot.
Output Specification
Output lines: line of output should contain the described number after instruction.
Sample Input 1
1 3
0 -10
ISI
Sample Output 1
11
12
13
Sample Input 2
3 5
0 0
1 1
1 -1
SIJJZ
Sample Output 2
5
4
3
4
5
Comments