#include <bits/stdc++.h>
using namespace std;
int T,N,M,K;
int main() {
    cin >> T;
    for (int t=1;t<=T;t++){
        cin >> N >> M >> K;
        if (N==M and K==1)
            cout << "Nie" << endl;
    }
    return 0;
}