#include <iostream>
using namespace std;
bool is_prime(int n)
{
if(n<2) return false;
for(int i = 2;i*i<=n;i++)
{
if(n%i == 0)
{
return false;
}
}
return true;
}
void check(int n)
{
for(int i=2; i<= n/2; i++)
if(is_prime(i) && is_prime(n-i))
{
cout<<"TAK "<<i<<' '<<n-i<<endl;
return;
}
cout<<"NIE\n";
}
int main() {
int t, n;cin>>t;
while(t--)
{
cin>>n;
check(n);
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKYm9vbCBpc19wcmltZShpbnQgbikKewoJaWYobjwyKSByZXR1cm4gZmFsc2U7Cglmb3IoaW50IGkgPSAyO2kqaTw9bjtpKyspCgl7CgkJaWYobiVpID09IDApCgkJewoJCQlyZXR1cm4gZmFsc2U7CgkJfQoJfQoJcmV0dXJuIHRydWU7CiB9IAogCnZvaWQgY2hlY2soaW50IG4pCnsKCWZvcihpbnQgaT0yOyBpPD0gbi8yOyBpKyspCgkJaWYoaXNfcHJpbWUoaSkgJiYgaXNfcHJpbWUobi1pKSkKCQl7CgkJCWNvdXQ8PCJUQUsgIjw8aTw8JyAnPDxuLWk8PGVuZGw7CgkJCXJldHVybjsKCQl9Cgljb3V0PDwiTklFXG4iOwp9CiAKaW50IG1haW4oKSB7CiAgCiAgCWludCB0LCBuO2Npbj4+dDsKICAJd2hpbGUodC0tKQogIAl7CiAgCQljaW4+Pm47CiAgCQljaGVjayhuKTsKCSAgfQogICAgcmV0dXJuIDA7Cn0g