#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, a, b, c, d;
  cin >> t;
  while (t--) {
    cin >> a >> b >> c >> d;
    int res = 1;
    if (a & 1) res *= -1;
    if (b & 1) res *= -1;
    if (res == 1) {
      cout << "Tidak Tidak ";
      if (b || c)
        cout << "Ya ";
      else
        cout << "Tidak ";
      if (a || d)
        cout << "Ya";
      else
        cout << "Tidak";
      cout << endl;
    } else {
      if (a || d)
        cout << "Ya ";
      else
        cout << "Tidak ";
      if (b || c)
        cout << "Ya ";
      else
        cout << "Tidak ";
      cout << "Tidak Tidak" << endl;
    }
  }
}
