// https://szkopul.edu.pl/problemset/problem/hEqgOgBDcuRvTHRRYD3eulf8/site/?key=statement
// Trójkąty
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
int main() {
std::ios_base::sync_with_stdio(0);
std::cin.tie(0);
std::cout.tie(0);
std::vector<double> v;
int n;
std::cin >> n;
for (int i = 0; i < n; i++) {
std::string s;
std::cin >> s;
std::string delimiter = "/";
int a = 0, b = 0;
size_t pos = 0;
std::string token;
while ((pos = s.find(delimiter)) != std::string::npos) {
token = s.substr(0, pos);
a = std::stoi(token);
// std::cout << token << std::endl;
s.erase(0, pos + delimiter.length());
}
// std::cout << s << std::endl;
b = std::stoi(s);
v.push_back((double)(a) / (double)(b));
}
std::sort(v.begin(), v.end());
if (v[0] + v[1] > v[v.size() - 1]) {
std::cout << "TAK\n";
} else {
std::cout << "NIE\n";
}
return 0;
}