Someone is going through his final year of high school. For privacy reasons, we will refer to him as "the CS nerd." He is thinking about prom and one specific girl. For privacy reasons, we will refer to her as "the girl."
The CS nerd wants to get the girl's attention. Upon asking his equally nerdy CS friends, he was suggested to air-drop thousands of papers littered with equations of cardioid graphs over the girl's house (the girl might or might not know what these equations even mean). However, the CS nerd needs many dimes/quarters to buy copious amounts of paper in order to accomplish this task. He isn't sure whether quarters (25 cents) are more efficient to bring than dimes (10 cents).
To help solve this question, his friends made very precise measurements of dimes and quarters. Dimes were measured ~D~ times ~(1 \leq D \leq 1\,000)~ and quarters were measured ~Q~ times ~(1 \leq Q \leq 1\,000)~. It is guaranteed that each measurement is an integer between ~1~ and ~10^6~.
After the friends made the measurements, they are still not sure about which coin is better. They want their answer to be 100% certain.
A coin's value is defined as number of cents divided by the mass. A 5 cent coin with a mass of 4 mg would have a value of 1.25.
Dimes are better if the heaviest dimes are strictly more valuable than the lightest quarters.
For example, if the heaviest dime weighs 1000 mg and the lightest quarter weighs 2501 mg, then dimes are better. If instead, the lightest quarter weighs 2500 mg, the answer cannot be 100% certain because neither coin would be better.
Similarly, quarters are better if the heaviest quarters are strictly more valuable than the lightest dimes.
Please help determine whether quarters or dimes are better!
The first line contains the integer ~D~.
The second line contains ~D~ space separated integers, which are the weights of the measured dimes.
The third line contains the integer ~Q~.
The fourth line contains ~Q~ space separated integers, which are the weights of the measured quarters.
If dimes are better, output
Dimes are better.
If quarters are better, output
Quarters are better.
Neither coin is better.
Sample Input 1
5 1112 1101 1079 1104 1113 5 2605 2643 2618 2648 2656
Sample Output 1
Quarters are better
Sample Input 2
1 1000 1 2500
Sample Output 2
Neither coin is better