You have a robot standing on the origin of x axis. The robot will be given some instructions. Your task is to predict its position after executing all the instructions.
LEFT: move one unit left (decrease p by 1, where p is the position of the robot before moving)
RIGHT: move one unit right (increase p by 1)
SAME AS i: perform the same action as in the i-th instruction. It is guaranteed thati is a positive integer not greater than the number of instructions before this.
The first line contains the number of test cases T (T100). Each test case begins with an integer n (1n100), the number of instructions. Each of the following nlines contains an instruction.