Decent Sequence

아직 제출이 없습니다시간 제한2초메모리 제한1024 MB

문제

The array aa 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, 3], \[1,2,2,1]\[1, 2, 2, 1] and \[3]\[3] are decent, while \[3,2,2,8]\[3, 2, 2, 8] is not.

There is an array aa consisting of nn integers, which is not given to you. You are, however, given nn integers l_il\_i and nn integers r_ir\_i. It is known that for all indices ii from 11 to nn we have l_ia_ir_il\_i \leq a\_i \leq r\_i. Is aa decent?

You have to give one of the three answers:

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

입력

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

Each of the following nn lines contains two integers l_il\_i and r_ir\_i (1l_ir_i1091 \leq l\_i \leq r\_i \leq 10^9) describing the range containing the element a_ia\_i.

출력

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

Output "NEIN" (without quotes) if aa 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.