After a long day of programming challenges, you decide to relax with your friends by playing darts. The only problem is that none of your friends (nor the author) have any clue how scoring works! Rather than try to learn, you simply devise your own rules. The rules you come up with are as follows:
For example, if your darts land in wedges $1$, $10$, and $7$ on your turn, you would calculate the sum around the dart board from wedge $1$ through wedge $10$ ($1 + 18 + 4 + 13 + 6 + 10 = 52$), the sum around the dart board from wedge $10$ through wedge $7$ ($10 + 15 + 2 + 17 + 3 + 19 + 7 = 73$) and the sum around the dart board from wedge $7$ through wedge $1$ ($7 + 16 + 8 + 11 + 14 + 9 + 12 + 5 + 20 + 1 = 103$). The sum around the dart board from wedge $7$ through wedge $1$ is the largest sum, so your score would be $103$ points.
The order of the wedges on the dartboard, starting from the top and going clockwise, is $20$, $1$, $18$, $4$, $13$, $6$, $10$, $15$, $2$, $17$, $3$, $19$, $7$, $16$, $8$, $11$, $14$, $9$, $12$, $5$.
The first line contains a single integer $N$, representing the number of players.
The subsequent $N$ lines each contain three ($3$) space-separated integers $w_1$, $w_2$, and $w_3$ (in that order). Each $w_i$ represents the wedge number that the $i^\text{th}$ dart for that player landed in.
The output should contain $N$ lines. Each line should contain the score for the corresponding player, in the same order in which they appear in the input.