#include <iostream>
using namespace std;

unsigned long long int Sum(int d){
    return d*(d+1) / 2;
}
int main(){
    int t;
    cin >> t;

    while(t--){
        int i, n, k;
        unsigned long long int m;
        cin >> n >> m >> k;
        cout << (m >= Sum(n - k + 1) ? "Tak" : "Nie") << endl;
    }
    return 0;
}