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
57
58
59
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <list>
#include <climits>
#include <string>
#include <stack>
#include <map>
#include <set>
#include <cmath>
#include <cstdio>

#define ALL(v) v.begin(), v.end()
#define REP(i, a, b) for(unsigned int i = a; i < b; i++)
#define REPD(i, a, b) for(unsigned int i = a; i > b; i--)
#define FOR(i, a, b) for(int i = a; i <= b; i++)
#define FORD(i, a, b) for(int i = a; i >= b; i--)
#define LOG(i) cout << "heh" << i << endl;
#define INF 1000000001

#define PB push_back
#define MP make_pair
#define PI pair<int, int>
#define st first
#define nd second

using namespace std;

int z, n;
long long F[55];
set<long long> S;

int main()
{
    F[0] = 0;
    F[1] = 1;
    REP(i, 2, 55) {
        F[i] = F[i-1] + F[i-2];
    }

    REP(i, 0, 55) {
        REP(j, 0, 55) {
            S.insert(F[i] * F[j]);
        }
    }

	cin >> z;

	while(z--) {
        cin >> n;
        if(S.find(n) != S.end()) cout << "TAK" << endl;
        else cout << "NIE" << endl;
	}



    return 0;
}