All submissions for this problem are available.### Read problem statements in [Hindi](http://www.codechef.com/download/translated/AUG19/hindi/CHEFDIL.pdf), [Bengali](http://www.codechef.com/download/translated/AUG19/bengali/CHEFDIL.pdf), [Mandarin Chinese](http://www.codechef.com/download/translated/AUG19/mandarin/CHEFDIL.pdf), [Russian](http://www.codechef.com/download/translated/AUG19/russian/CHEFDIL.pdf), and [Vietnamese](http://www.codechef.com/download/translated/AUG19/vietnamese/CHEFDIL.pdf) as well. Chef has no work to do in the kitchen, so he decided to play a card game with the following rules: - Initially, $N$ cards are placed in a row on a table. Each card is placed either face up or face down. - The goal of the game is to remove all cards from the table, one by one. - A card may be removed only if it is currently facing up. - When a card is removed, its adjacent cards (the cards directly to its left and right, if they exist) are flipped, i.e. a card that was facing up will be facing down and vice versa. - There is an empty space left behind each removed card, i.e. the remaining cards are not moved to create a contiguous row of cards again. Therefore, if the game starts with three cards and the middle card is removed, then the cards on the sides are flipped, but removing one of these cards afterwards does not cause the other card to be flipped, since it is only adjacent to the empty space created by removing the middle card. Determine whether Chef is able to win this game. ### Input - The first line of the input contains a single integer $T$ denoting the number of test cases. The description of $T$ test cases follows. - The first line of each test case contains a single string $S$ describing the row of cards initially placed on the table. Each character of this string is either '1', denoting a face up card, or '0', denoting a face down card. ### Output For each test case, print a single line containing the string `"WIN"` if Chef can win the game or `"LOSE"` if he cannot win (without quotes). ### Constraints - $1 \le T \le 10^2$ - $1 \le |S| \le 10^5$ ### Subtasks **Subtask #1 (30 points):** - $1 \le T \le 10$ - $1 \le |S| \le 100$ **Subtask #2 (70 points):** original constraints ### Example Input ``` 1 10 ``` ### Example Output ``` WIN ``` ### Explanation **Example case 1:** First, Chef should remove the first card, which makes the second card face up. Then, he should remove the second card. This way, all cards are removed and Chef wins.
|Tags||aug19, easy, game-theory, observations, utkarsh22garg, utkarsh22garg, vijju123|
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, SQL, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, R, COB, FS|
Fetching successful submissions