시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB63375.000%

문제

Little Bytie really enjoys watching Formula One races which are held annually on a track between Bytetown and Byteburg. The most exciting moments for him are overtakes. He would like to see as many of them as possible.

Bytie is dreaming of a race in which n Formula One cars compete and the car that started the race at the i-th position (for each 1 ≤ i ≤ n) performs ai overtakes during the race. We assume for simplicity that at each moment of time at most one overtaking takes place, in which exactly two cars participate (that is, one car goes past another car).

Bytie is wondering whether such a race is possible at all. Could you help him figure this out?

입력

The first line of input contains one positive integer t that represents the number of test cases that follow.

Each test case is described in two lines. The first line contains one integer n (1 ≤ n ≤ 1 000 000): the number of cars that participate in the race. The second line holds a sequence of n integers a1, a2, . . . , an (0 ≤ ai ≤ 109) that gives the number of overtakes performed by the respective cars.

The size of a single input file does not exceed 20 MB.

출력

Your program should output t lines containing answers to the respective test cases. Each line should hold a single word TAK (Polish for yes) or NIE (Polish for no) depending on whether the race described by the test case is possible or not.

예제 입력 1

3
2
0 1
3
0 1 4
3
1 1 3

예제 출력 1

TAK
NIE
TAK