시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 (추가 시간 없음) 1024 MB54480.000%

문제

The array $a$ is decent if it can be split into two consecutive parts (possibly empty), such that the first one (the prefix) is non-decreasing, and the second (the suffix) is non-increasing. For example, $[1, 2, 3]$, $[1, 2, 2, 1]$ and $[3]$ are decent, while $[3, 2, 2, 8]$ is not.

There is an array $a$ consisting of $n$ integers, which is not given to you. You are, however, given $n$ integers $l_i$ and $n$ integers $r_i$. It is known that for all indices $i$ from $1$ to $n$ we have $l_i \leq a_i \leq r_i$. Is $a$ decent?

You have to give one of the three answers:

  1. $a$ is definitely decent.
  2. $a$ is definitely not decent.
  3. Neither of the above is the case.

입력

The first line contains a single integer $n$ ($1 \leq n \leq 10^6$), the length of $a$.

Each of the following $n$ lines contains two integers $l_i$ and $r_i$ ($1 \leq l_i \leq r_i \leq 10^9$) describing the range containing the element $a_i$.

출력

Output "TAK" (without quotes) if $a$ is definitely decent.

Output "NEIN" (without quotes) if $a$ is definitely not decent.

Output an arbitary string consisting of at least five but not more than 100 lowercase or capital english letters otherwise. If you output something really inappropriate you might get Presentation Error. Both of the possible answers in the samples are not considered inappropriate.

예제 입력 1

3
3 4
2 5
1 1

예제 출력 1

TAK

예제 입력 2

4
3 4
1 3
1 2
3 10

예제 출력 2

NEIN

예제 입력 3

3
1 10
1 10
1 10

예제 출력 3

NEITHER

예제 입력 4

4
1 2
1 1
1 1
1 2

예제 출력 4

Secret