#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    bool prob[5];
    for (bool& i : prob) {
      i = true;
    }
    if ((a == 0 && b == 0) || (a + b) % 2 == 0) {
      prob[1] = prob[2] = false;
      if (a == 0 && d == 0) {
        prob[4] = false;
      } else if (b == 0 && c == 0) {
        prob[3] = false;
      }
    } else {
      prob[3] = prob[4] = false;
      if (a == 0 && d == 0) {
        prob[1] = false;
      } else if (b == 0 && c == 0) {
        prob[2] = false;
      }
    }
    for (int i = 1; i <= 4; i++) {
      cout << (prob[i] ? "Ya " : "Tidak ");
    }
    cout << endl;
  }
}
