#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
int main() {
  int t;
  cin >> t;
  for (int tc = 0; tc < t; tc++) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    int temp = 1;
    if (a % 2) {
      temp *= -1;
    }
    if (b % 2) {
      temp *= -1;
    }
    if (temp == 1) {
      cout << "Tidak Tidak ";
      if (b > 0 || c > 0) {
        cout << "Ya ";
      } else {
        cout << "Tidak ";
      }
      if (a > 0 || d > 0) {
        cout << "Ya" << endl;
      } else {
        cout << "Tidak" << endl;
      }
    } else {
      if (a > 0 || d > 0) {
        cout << "Ya ";
      } else {
        cout << "Tidak ";
      }
      if (b > 0 || c > 0) {
        cout << "Ya ";
      } else {
        cout << "Tidak ";
      }
      cout << "Tidak Tidak" << endl;
    }
  }
  return 0;
}
