This page is still under construction.

Parts of this page are still being built. What you see may change.

Even Sum Versus Odd Sum

Interview

Time limit1sMemory limit128 MB

Summary
For each of up to 50 sequences, add the even numbers and the odd numbers separately and print EVEN, ODD, or TIE based on which sum is larger.
Level

Easy1 of 10

Topics
Array, Implementation
Solved
No attempts yet

Problem

When new programs arrive in the grid world, they begin by playing the simplest games in the Disc Arena against other novice programs. One of those games is played in front of a large board as follows: a sequence of numbers appears on the board, and the players must decide whether the sum of the even numbers in the sequence is larger than the sum of the odd numbers, whether the sum of the odd numbers is larger, or whether the two sums are equal. The first player to give the correct answer wins, and the losers are deleted.

For example, for the sequence 5, 7, 2, 1, 10, 13, 6, 12 the sum of the even numbers is 2+10+6+12=302 + 10 + 6 + 12 = 30, while the sum of the odd numbers is 5+7+1+13=265 + 7 + 1 + 13 = 26, so the correct answer is "EVEN".

Help Sam, our protagonist, win this game so he can survive and keep searching for his father.

Input

The first line contains the number of test cases TT (T≤50T \le 50). Each of the following lines contains one test case. A test case begins with the length of the sequence kk (k<100k < 100), followed by the kk integers that make up the sequence. Every number is at least 00 and less than 2202^{20}.

Output

For each test case, print one line containing "EVEN" if the sum of the even numbers is larger than the sum of the odd numbers, "ODD" if the sum of the odd numbers is larger, or "TIE" if the two sums are equal.

Examples3

  1. Example 1

    Input
    4
    8 5 7 2 1 10 13 6 12
    4 5 2 3 4
    8 1 2 1 2 1 1 1 1
    6 1 1 2 3 5 8
    
    Expected output
    EVEN
    ODD
    ODD
    TIE
    
  2. Example 2

    Input
    1
    3 2 4 6
    
    Expected output
    EVEN
    
  3. Example 3

    Input
    1
    3 1 3 5
    
    Expected output
    ODD