1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include <iostream>
#include <string>

using namespace std;

class Program
{
    // fields
    int n;
    string word;
    bool is_palindrome;

public:
    // constructor
    Program()
    {
        cin >> n;

        char c = ' ';
        cin.get(c);
        while (true)
        {
            cin.get(c);
            if (c != '\n') word += c;
            else break;
        }
    }

    void Start()
    {
        for (int i = 0; i < word.length() / 2; i++)
        {
            if (word[i] != word[word.length() - i - 1])
            {
                is_palindrome = false;
                return;
            }                
        }
        is_palindrome = true;
    }

    string GetAnswer()
    {
        if (is_palindrome) return "TAK";
        else return "NIE";
    }
};


int main()
{
    Program P;
    P.Start();
    cout << P.GetAnswer() << endl;
    return 0;
}