#include <bits/stdc++.h>

using namespace std;

#define pii pair<int,int>
#define ll long long
#define s second
#define f first

ll t, n, m, k;

bool can(){
  cin >> n >> m >> k;
  if(m - k + 1 < (n - k + 1) * (n - k + 2) / 2){
    return false;
  }
  return true;
}

int main(){
  cin >> t;
  while(t--){
    if(can()){cout << "Tak" << endl;}
    else{cout << "Nie" << endl;}
  }
  return 0;
}