Institute of Advanced Category Manipulation

No attempts yetTime limit1sMemory limit128 MB

Problem

A magazine ranks the country's universities every year in a number of categories, as a service to readers who are deciding where to study. Each university gets three scores RR, TT, and SS, integers from 0 to 100, for research, teaching, and community service. The magazine interprets those scores somehow and names the top university in each category. There are many categories to compete in, such as research university, undergraduate university, small university, and so on. Sometimes a category looks invented only so that one particular university comes out on top, for example the top university in a rural area with a population of 30,000 to 45,000.

The Institute of Advanced Category Manipulation (ACM) is unhappy with its ranking, because it is not the top university in any category. The public relations department of ACM decided that it can invent its own category of universities and rank every university by a linear combination of the three scores. The combined score UU of a university is

U=aR+bT+cSU = aR + bT + cS

where aa, bb, and cc are real constants. So that readers do not notice the scores suddenly growing too large or too small, the constants must satisfy a2+b2+c2=1a^2 + b^2 + c^2 = 1. Some scores of ACM are low compared to its peers, so the department even allows any of aa, bb, and cc to be negative. A university is a top university in the new category if its combined score is greater than or equal to the combined score of every other university. A category is exactly one triple (a,b,c)(a, b, c) that satisfies the constraint above.

The idea is catching on quickly among university administrators. The Research University of Ivory Towers, for example, decided to use (a,b,c)=(0.57735,0.57735,0.57735)(a, b, c) = (0.57735, -0.57735, -0.57735). Even with this manipulation, some universities can never be top universities. In the second case of the example input below, The University of Mediocrity has R=T=S=50R = T = S = 50 and cannot be a top university among the given universities no matter how it manipulates the categories.

You are given the research, teaching, and community service scores of some universities. Determine which of them can be a top university.

Input

The first line contains a single integer, at most 10, the number of test cases. The first line of each test case contains a positive integer nn (1n501 \le n \le 50), the number of universities to consider. Each of the next nn lines contains three integers, the research, teaching, and community service scores of one university.

Output

For each test case, print one line holding a string of nn characters. The ii-th character is T if the ii-th university given in that test case can be a top university, and F otherwise.