#include <iostream>
int main()
{
int c;
std::cin >> c;
while (c-- > 0)
{
int a, b, d, e, f;
std::cin >> a;
if (a==1) { std::cout << "NIE" << std::endl; }
else
if (a==2||a==3||a==5||a==7) {
std::cout << "TAK" << std::endl;
}
else {
b = a % 2;
e = a % 3;
d = a % 5;
f = a % 7;
if (b == 0 || d == 0 || e == 0 || f == 0) {
std::cout << "NIE" << std::endl;
}
else {
std::cout << "TAK" << std::endl;
}
}
}
return 0;
}
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}