A neuron node takes two inputs, X1 and X2. Each input is 0 or 1. Every input carries its own weight: W1 belongs to X1 and W2 belongs to X2. The node also has a bias B, which moves the point where the node turns on.
The node first computes the weighted sum
A=X1W1+X2W2+B
and then applies a step activation function. The output is 1 when A≥0, and 0 otherwise.

Figure 1. Neuron node
A machine learning class asked its students to pick weights and a bias so that one neuron node computes a logical AND, or a logical OR. You are the teaching assistant, so you have to check the submissions. A submission is correct when the output of the node equals the value of the requested logical function for all four combinations of X1 and X2.
The first line contains the number of test cases T (1<T<200).
Each of the next T lines describes one submission: a word, then three real numbers W1, W2 and B, separated by whitespace. The word is either AND or OR and names the logical function that submission has to compute. W1 and W2 are the weights (−2.5≤W1,W2≤2.5) and B is the bias (−5≤B≤5). The numbers may contain a decimal point, and two tokens may be separated by more than one space.
Print one line for each test case, in input order. Print true when the node computes the requested logical function for all four combinations of X1 and X2, and false otherwise. Print both words in lowercase and without quotes.