The Flying Dutchman

0

0 votes
Problem

The crew of the Flying Dutchman are fond of betting their years of service in a very interesting game. They have a stack of blocks with them. On each block is written a number. In his turn, a player can remove one or two blocks from the top of the stack. The numbers written on the removed blocks are added to the score of the player who removes them. The game ends when there are no more blocks to remove. The player with the greater score at the end of the game wins. If the scores are equal, the game is a draw.

Now, Will Turner is aboard The Flying Dutchman, courtesy of Jack Sparrow. He meets his father and decides to free him from the service of Davy Jones. In order to do so, he must find the heart of Davy Jones kept safely in a chest. The key to open the chest is with Davy Jones, the captain of the ship. He decides to challenge Davy Jones to a game. He bets his entire lifetime of service against the key of the chest. Davy Jones being the captain of the ship gets to play the first chance.

Given the numbers on all the blocks, determine whether Will Turner will win the key or serve his lifetime aboard The Flying Dutchman. Assume that both, Will and Davy Jones play optimally.

Input

The first line contains T, the number of test cases. T test cases follow.

The first line of each test case contains a number N. The next line contains N space separated integers which represent the numbers on the blocks of the stack from top to bottom.

Output

For each test case, output in a new line, the fate of Will Turner i.e. "WIN", "LOSE" or "DRAW" (quotes for clarity only).

Constraints

1<= T <=30

1<= N <=100000

0<= Number on Block <=10^9

Warning

Large I/O files. Use printf/scanf instead of cin/cout

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

In first test case, Davy Jones will pick up 1,1,1 and Will will pick 0, 0 if both play optimally. Since the score of Davy Jones is more than that of Will, Will loses. In the third case, score of both of them is same. Thus the game is draw.

Editor Image

?