import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n2 = Integer.parseInt(br.readLine());
        String[] vals2 = new String[n2];
        for (int i = 0; i < n2; i++) {
            vals2[i] = br.readLine();
        }
        for (int i = 0; i < n2; i++) {
            String[] vals = vals2[i].split(" ");
            int n = Integer.parseInt(vals[0]);
            int m = Integer.parseInt(vals[1]);
            int k = Integer.parseInt(vals[2]);
            int r = n - (k - 1);
            if ((r * (r + 1) / 2) + (k - 1) <= m) {
                System.out.println("Tak");
            } else {
                System.out.println("Nie");
            }
        }
    }

}