#include <bits/stdc++.h>
using namespace std;
void check() {
  long long a, b, c, d, x[4] = {0, 0, 0, 0};
  cin >> a >> b >> c >> d;
  if ((a + b) % 2 == 0) {
    if (b != 0 || c != 0) x[2] = 1;
    if (a != 0 || d != 0) x[3] = 1;
  } else {
    if (b != 0 || c != 0) x[1] = 1;
    if (a > 0 || d > 0) x[0] = 1;
  }
  for (long long i = 0; i < 4; i++)
    if (x[i] == 1)
      cout << "Ya"
           << " ";
    else
      cout << "Tidak"
           << " ";
  cout << "\n";
}
signed main() {
  long long t;
  cin >> t;
  while (t--) check();
  return 0;
}
