Bajtazar's company makes wooden wardrobes with mirrored doors. The company does the woodwork itself and subcontracts the mirrors.
A tender run by the company has just closed. n workshops took part, and each one stated the mirror sizes it can produce. Every mirror is a rectangle. A workshop's bid gives the smallest and the largest width it can produce, and the smallest and the largest height. Mirrors cannot be rotated when a wardrobe is built.
If one workshop's bid covers all the other bids, meaning no other bidder offers a mirror size that this workshop cannot produce, that workshop wins the tender. If several workshops submit a covering bid, the one with the lowest price per square centimetre of mirror wins. If no such workshop took part, the review gets complicated and the award is delayed by a lot. Bajtazar wants to avoid a pointless argument, so he asked you to write a program that decides whether some workshop's bid covers all the other bids.
The first line contains one integer t (1≤t≤10), the number of test cases. Descriptions of the t test cases follow.
The first line of each description contains one integer n (2≤n≤100000), the number of mirror workshops that bid in the tender. Each of the next n lines contains four integers w1, w2, h1, h2 (1≤w1≤w2≤109, 1≤h1≤h2≤109). That workshop can produce a mirror of every integer width w and every integer height h with w1≤w≤w2 and h1≤h≤h2.
Print exactly t lines, one per test case. Line i contains TAK if the i-th test case has a workshop whose bid covers all the other bids, and NIE otherwise.