#include<iostream>
using namespace std;

int main(){
    int t,n,m,k;
    cin >> t;
    for (int q=0;q<t;q++){
        cin >> n >> m >> k;
        int i=1;
        while (n>0){
            if (n>=k && m>=k*i) {
                n=n-k;
                m=m-k*i;
                i++;
            }
            else{
                if (n<k){
                    if (m>=n*i) {cout << "Tak" << "\n";}
                    if (m<n*i) {cout << "Nie" << "\n";}
                }
                else {
                    if (m<k*i) {cout << "Nie" << "\n";}
                }
            }
        }
    }
    return 0;
}