#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 x = floor(((2*n-1)-sqrt(pow(2*n+1, 2)-8*k))/2);
    int res = k-(2*n-x)*(x+1)/2;
    //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");
    }


}