The first line contains a single integer T(1≤T≤100), denoting the number of test cases.
For each test case, the first line contains a single integer n(1≤n≤1000), denoting the number of stars.
Each of the following nlines describes a stars. The i-th line of them contains 4 integers xi,yi,ui,vi(−1000≤xi,yi≤1000,1≤ui<vi<P=31607)indicating the coordinate of the i-th star and the probability of the i-th star to become visible. It is guaranteed that no two stars share the same coordinate.
There are at most 3test cases satisfying n>20.