The input contains multiple test cases. The first line of the input, contains t, the number of test cases that follow. Each of the following t blocks, describes a test case.
The first line of each block contains one integer n (0 <= n <= 26). After this, there are n lines, each containing one capital alphabet letter, followed by two integers a and b, (0 <= a < b <= 1000). The capital letter shows the key pressed. The number a is the first time step at which the key is pressed and the number b is the second time step at which the key is pressed. During the interval a, a + 1, . . . , b -1, theLED of the key is on. You can assume that, in each test case, these letters are distinct.