P6312 [PA 2018] Palindrom

Description

**Translated from [PA 2018](https://sio2.mimuw.edu.pl/c/pa-2018-1/dashboard/) Round 3 [Palindrom](https://sio2.mimuw.edu.pl/c/pa-2018-1/p/pal/).** **Please pay special attention to the memory limit of this problem.** Given a string, determine whether it is a palindrome. A palindrome is a string that reads exactly the same from left to right as from right to left.

Input Format

The first line contains an integer $n$. In some testdata it represents the length of the string, and in some testdata $n = 0$ (which means the length is not given). The second line contains a string, which is the string to be checked.

Output Format

If it is a palindrome, output `TAK`; otherwise output `NIE`.

Explanation/Hint

#### Constraints **This problem uses bundled tests.** For $100\%$ of the testdata, the length of the string does not exceed $2 \times 10^7$. You may assume that in any testdata, either $n > 0$ or $n = 0$. Thanks to @[Infinite_Eternity](/user/897776) for providing the testdata. Translated by ChatGPT 5