One of the shops of N-sky machine-building plant produces spare parts for cars. In order to monitor the quality, the weight of every detail is to be controlled. For that there is a special controlling person in charge. Unfortunately, the controller in this checking unit is rather lazy, and instead of weighing every detail separately, he decides to «optimize» the process a little. Also all similar (of the same type) parts are supposed to be of the same weight.
At the end of the working day, a box with many identical parts arrives for inspection. The controller knows that a quality part should weigh a interger number of grams, but is too lazy to look into the documents and find out how much exactly.
The «optimized» control process is as follows:
Naturally, such an «optimized» process does not always reveal the presence of faulty spare parts, and does not indicate a specific defective part. The controller is so lazy that in the event of signs of a defective item rejects the entire batch. In all other cases, the batch receives a sign of quality.
Your task will be to write a program that, according to the weights register-book, will determine whether the batch will receive a quality mark or will be rejected.
The first line of the input file contains an integer $$$k$$$ $$$(1 \le k \le 1000)$$$. Next follow $$$k$$$ number of lines, each of which contains integers $$$a_i$$$ $$$(0 \lt a_i \le 1000)$$$ and $$$w_i$$$ $$$(0 \lt w_i \lt 1000000)$$$, separated by a space.
The output line should contain the word «DEFECT» if there are for sure defective parts in the batch, or «QUALITY» if there are no signs of defective parts.
3
10 30
5 15
2 6
QUALITY
2
2 5
4 10
DEFECT
The participant must display «QUALITY» in the event that there are no definite signs of defect, even if there is not enough data for an unambiguous conclusion about the quality of the details
| Name |
|---|


