Training Site
Sideways banner

Chess

Input: Standard Input (stdin)
Output: Standard Output (stdout)
Memory limit: 128 megabytes
Time limit: 2.0 seconds

You awaken to find yourself in a world where the ground is an infinite chessboard, with the usual black and white chequered squares. Without missing a beat, you instantly number each of the rows and columns with integers, denoting the square found in column x and row y as (x, y). You label the square you woke up in as (0, 0), which you notice is black. It's only natural that you now have N questions, each of which are in the following form: what colour is square (a, b)?

You set out to write a program that can solve these questions for you. After all, you do have eternity trapped in here...

Input

The first line of input contains an integer N.

The following N lines of input each contain 2 integers a and b.

Output

Your program should output N lines. Each one should be either BLACK or WHITE, depending on the answer to one of the queries. The output should be given in the same order as the input. That is to say, the first line of output should answer the first query, the second the second, and so on to the Nth.

Constraints

1 ≤ N ≤ 50,000

0 ≤ a, b ≤ 10^{9}

Subtasks

  • Subtask 1 (20%): a = 0
  • Subtask 2 (20%): a is even.
  • Subtask 3 (30%): 0 ≤ a, b ≤ 500
  • Subtask 4 (30%): No further constraints.

Sample One Explanation

The image above illustrates Sample Input 1.

  • For the first query the (0, 0) square is black.
  • For the second query the (0, 5) square is white.
  • The (4, 0) square is black.
  • The (9, 7) square is black.
  • The (4, 10) square is black.
  • Sample Input 1

    5
    0 0
    0 5
    4 0
    9 7
    4 10
    

    Sample Output 1

    BLACK
    WHITE
    BLACK
    BLACK
    BLACK
    
  • Sample Input 2

    5
    707738751 508566762
    449028052 11000071
    414058577 473976523
    714308666 726423307
    55501332 514013400
    

    Sample Output 2

    WHITE
    WHITE
    BLACK
    WHITE
    BLACK