#include <bits/stdc++.h>

int main() {
    int t;
    scanf("%d",&t);
    for (int i = 0; i < t; ++i) {
    unsigned long long n,k,m;
    scanf("%lld%lld%lld",&n,&k,&m);
    if (n>k){printf("Nie\n");continue;}
    if (m>n) {printf("Nie\n");continue;}
    if (m>k) {printf("Nie\n"); continue;}
    if (k>=(n*(n+1))/2) {printf("Tak\n"); continue;}
    int x1 = floor(((2*n-1)+sqrt(pow(2*n+1, 2)-8*k))/2);
    int x2 = floor(((2*n-1)-sqrt(pow(2*n+1, 2)-8*k))/2);
    int res1 = k-(2*n-x1)*(x1+1)/2;
    int res2 = k-(2*n-x2)*(x2+1)/2;
    int res = res1;
    int x = x1;
    if (res1 < 0) {res = res2;x = x2;}
    if (n < x1) {res = res2; x = x2;}
    //std::cout << x1  << ' ' << x2 << ' ' << res1 << ' ' << res2 << "\n";
    //std::cout << x << ' ' << res << '\n';
    int d = res;
    if (res == 0) d = x;
    //std::cout << d << '\n';
    int r = (n-d);
    if (r<=m) printf("Tak\n");
    else printf("Nie\n");
    }


}