"How on earth am I supposed to set my employees' salaries?" wondered director Karierowitch. "I want everyone paid in proportion to their effectiveness. But effectiveness keeps changing, and surely I will never have two employees with exactly the same effectiveness at the same time."
Many years have passed since then. In total, N employees have worked at the company over its history. Employee i is described by four integers si, ei, ai, bi: the employee was hired at time si, left the company (or the company let them go) at time ei, and at any moment t their effectiveness equals ai⋅t+bi.
Determine whether there was ever a moment in the company's history at which two employees who were both employed at that moment had exactly the same effectiveness.
The first line contains an integer Z (1≤Z≤10), the number of test sets. The test sets follow.
The first line of each test set contains an integer N (1≤N≤105), the number of employees in the company's history. Each of the next N lines contains four space-separated integers si, ei, ai, bi, where 0≤si,ei≤106 and −106≤ai,bi≤106.
For each test set, print on its own line "TAK" if there exists a moment at which some pair of simultaneously employed employees had the same effectiveness, and "NIE" otherwise.