// iostream is too mainstream
#include <cstdio>
// bitch please
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <cmath>
#include <iomanip>
#define dibs reserve
#define OVER9000 1234567890
#define ALL_THE(CAKE,LIE) for(auto LIE =CAKE.begin(); LIE != CAKE.end(); LIE++)
#define tisic 47
#define soclose 1e-8
#define chocolate win
// so much chocolate
#define patkan 9
#define ff first
#define ss second
#define abs(x) ((x < 0)?-(x):x)
#define uint unsigned int
#define dbl long double
using namespace std;
// mylittledoge
struct pt {
unsigned long long x,y,z;
};
pt vs(pt A, pt B) {
pt ret;
ret.x =A.y*B.z-A.z*B.y;
ret.y =A.z*B.x-A.x*B.z;
ret.z =A.x*B.y-A.y*B.x;
return ret;}
int main() {
cin.sync_with_stdio(0);
cin.tie(0);
int N;
cin >> N;
vector<pt> P(N);
if(N < 3) {cout << "TAK\n"; return 0;}
for(int i =0; i < N; i++) cin >> P[i].x >> P[i].y >> P[i].z;
for(int i =1; i < N; i++)
P[i].x -=P[0].x, P[i].y -=P[0].y, P[i].z -=P[0].z;
int nepr =-1;
pt V;
for(int i =2; i < N; i++) {
V =vs(P[i],P[1]);
if(V.x == 0 && V.y == 0 && V.z == 0) continue;
nepr =i;
break;}
if(nepr == -1) {cout << "TAK\n"; return 0;}
for(int i =2; i < N; i++)
if(P[i].x*V.x+P[i].y*V.y+P[i].z*V.z != 0) {
cout << "NIE\n";
return 0;}
cout << "TAK\n";
return 0;}
// look at my code
// my code is amazing
Ly8gaW9zdHJlYW0gaXMgdG9vIG1haW5zdHJlYW0KI2luY2x1ZGUgPGNzdGRpbz4KLy8gYml0Y2ggcGxlYXNlCiNpbmNsdWRlIDxpb3N0cmVhbT4KI2luY2x1ZGUgPGFsZ29yaXRobT4KI2luY2x1ZGUgPGNzdGRsaWI+CiNpbmNsdWRlIDx2ZWN0b3I+CiNpbmNsdWRlIDxzZXQ+CiNpbmNsdWRlIDxtYXA+CiNpb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