You are a programmer and you are doing a programming test but this time there is a mistake counter. For every mistake you, the online judge will give a value for your mistake. Once 4 mistakes are made, the value of the 4 mistakes are computed to see if you are disqualified.
How the computer decides if you are disqualified is by checking if the 4 numbers can be put into an equation where the resulting value is 24. The computer can use any basic operators ( '+', '-', '*', '/', '()') in any order. Every operation is a binary operation which means that they have to be done between two numbers (converting a 1 to a -1 is not allowed). Concatentation of two numbers is also not allowed.
For example:
values: 4, 1, 8, 7
equation: (8 - 4) * (7 - 1) = 24
values: 1, 2, 3, 2
equation: no equation can result in 24
Write a program that could do the same as the computer in the Online Judge!
* abs() function does not work on float values *
The first line contains the number of sets of values (1 <= q <= 100).
The following q lines containing 4 positive integers (1 <= a, b, c, d <= 1000).
"Safe" if the numbers can result in 24. "Disqualified" if not. Both followed with a newline.