#include <iostream>
using namespace std;

int main(){
int a; 
std::cin >> a;
if (a==1){
    int b, c, d; cin >> b >> c >> d;  }
if (a==2){
    int b, c, d; cin >> b >> c >> d;
    int e, f, g; cin >> e >> f >> g;}
if (a==3){
    int b, c, d; cin >> b >> c >> d;
    int e, f, g; cin >> e >> f >> g;
    int h, j, k; cin >> h >> j >> k;}
if (a==4){
    int b, c, d; cin >> b >> c >> d;
    int e, f, g; cin >> e >> f >> g;
    int h, j, k; cin >> h >> j >> k;
    int l, m, n; cin >> l >> m >> n;}
if (a==5){
    int b, c, d; cin >> b >> c >> d;
    int e, f, g; cin >> e >> f >> g;
    int h, j, k; cin >> h >> j >> k;
    int l, m, n; cin >> l >> m >> n;
    int o, p, q; cin >> o >> p >> q;}
if (a==6){
    int b, c, d; cin >> b >> c >> d;
    int e, f, g; cin >> e >> f >> g;
    int h, j, k; cin >> h >> j >> k;
    int l, m, n; cin >> l >> m >> n;
    int o, p, q; cin >> o >> p >> q;
    int r, s, t; cin >> r >> s >> t;}
if (a==7){
    int b, c, d; cin >> b >> c >> d;
    int e, f, g; cin >> e >> f >> g;
    int h, j, k; cin >> h >> j >> k;
    int l, m, n; cin >> l >> m >> n;
    int o, p, q; cin >> o >> p >> q;
    int r, s, t; cin >> r >> s >> t;
    int u, v, w; cin >> u >> v >> w;}
if (a==8){
    int b, c, d; cin >> b >> c >> d;
    int e, f, g; cin >> e >> f >> g;
    int h, j, k; cin >> h >> j >> k;
    int l, m, n; cin >> l >> m >> n;
    int o, p, q; cin >> o >> p >> q;
    int r, s, t; cin >> r >> s >> t;
    int u, v, w; cin >> u >> v >> w;
    int x, y, z; cin >> x >> y >> z;}
std::cout << "Tak" << std::endl << "Nie";
return 0;}