Aliens connected with people and sent a message containing the answer to "The Ultimate Question of Life, the Universe, and Everything".
People received n bytes (integers from 0 to 255 inclusive). The decoding algorithm is the following:
For each byte i, you are given the number c_i of received bytes i. Please decode the message.
The first line contains a single integer t (1≤t≤100) --- the number of test cases. Description of test cases follows.
The first line of each test case contains a single integer k (1≤k≤256) --- the number of bytes i such that c_i=0.
Each of the next k lines contains two integers i, c_i (0≤i≤255, 1≤c_i≤109). It is guaranteed that all given values i are different.
For all other 256−k bytes, the numbers c_i are equal to 0.
It is guaranteed that ∑_i=0255c_i=n≤109.
For each test case, print a single integer --- the decoded message.