F |
Game |
|
Input: Standard Input Output: Standard Output |
|
Alice and Bob are playing a 2 player game. The game has the following rules.
You are given the information
about the game.
First line of the input contains T (1≤T≤10) the number of test case. Then following lines contains T Test cases.
Each case starts with line containing 2 integers k (1≤k≤20) and q (1≤q≤10000). Each of the next q lines will contains 2 integers a and b (1≤a,b≤100000). Each of these a and b pair along with the initial k will be instance of a game.
For each game output will be a single line containing a stringing “WINNING” if Alice can win that game or “LOSING” if she can not win that game. Output a blank line after each test case.
1 1 4 2 5 2 6 1 3 1 4 |
WINNING LOSING LOSING WINNING |
Problemsetter: Abdullah al Mahmood
Special Thanks: Derek Kisman