#P4236. 扑克
扑克
Description
lsq’s deck has no Jokers and contains a total of cards. Since wzt is obsessed with exponentiation, he first proposed drawing cards each time (here “^” denotes exponentiation). lsq found that boring, so they changed the rule to drawing cards each time, where is a non-negative integer freely chosen by the player on their turn. lsq starts first, and the two players take turns drawing cards according to the rule. Whoever draws the last card wins.
Since they have plenty of time, lsq and wzt will play games in total, each with different and . wzt banged out some code and can compute the winning strategy once and are fixed. After seeing your “operations,” lsq hopes you can also write a program to determine whether he can win given and . Since lsq knows how to play optimally, you do not need to output the specific moves.
Note: In this problem, both players always choose a winning move whenever one exists.
Here is a non-negative integer that the player drawing the cards can decide on each turn. You can refer to the sample below for understanding.
Input Format
The first line contains one integer , indicating there are games.
The next lines each contain two integers , , as defined above.
Output Format
Output lines.
If lsq can win, output "lsq Win".
If wzt can win, output "wzt Win".
3
2 5
2 9
3 9
lsq Win
wzt Win
lsq Win
Hint
Constraints:
- For 30% of the testdata, , , .
- For 50% of the testdata, , , .
- For 100% of the testdata, , , .
Explanation for Sample 1:
- Query 1: lsq is guaranteed to win. lsq first draws . Afterwards, no matter whether wzt draws or , lsq can take all the remaining cards. Other draw orders are similar (just a different order).
- Query 2: wzt is guaranteed to win. If lsq first draws , then wzt draws . If lsq first draws , then wzt draws . Afterwards, no matter whether lsq draws or , wzt can take all the remaining cards. Other draw orders are similar (just a different order).
- Query 3: lsq is guaranteed to win; he only needs to take .
By Broadway
Translated by ChatGPT 5
京公网安备 11011102002149号