#K66997. Bread Quality Assessment

    ID: 32544 Type: Default 1000ms 256MiB

Bread Quality Assessment

Bread Quality Assessment

You are given a number of test cases and for each test case, the opinions of three inspectors on the quality of a bread loaf. Each inspector gives a decision represented by an integer: 1 for a positive opinion and 0 for a negative opinion. A loaf is considered GOOD if at least two inspectors approve it, i.e. if the sum of the three decisions satisfies \(\geq 2\). Otherwise, it is considered BAD.

Your task is to write a program that reads input from stdin and writes the result for each test case to stdout. Each result should be output on a new line as either "GOOD" or "BAD".

inputFormat

The first line contains a single integer \(T\) indicating the number of test cases. Each of the next \(T\) lines contains exactly three space-separated integers. Each integer is either 0 or 1 corresponding to the decision of an inspector.

outputFormat

For each test case, output a line containing either "GOOD" if the sum of the decisions is \(\geq 2\), or "BAD" otherwise.

## sample
3
1 1 0
0 0 0
1 0 1
GOOD

BAD GOOD

</p>