#include <bits/stdc++.h>
using namespace std;
const long long MAX = 2e5 + 5;
const long long MOD = 1e9 + 7;
long long testnum = 0;
long long testflag = 0;
void solve() {
  long long a, b, c, d;
  cin >> a >> b >> c >> d;
  bool aa = 0, bb = 0, cc = 0, dd = 0;
  if (b == 0 && c == 0) {
    if (a == 0 && d > 0) dd = 1;
    if (a > 0) (a % 2 == 1 ? aa = 1 : dd = 1);
    cout << (aa ? "Ya" : "Tidak") << ' ';
    cout << (bb ? "Ya" : "Tidak") << ' ';
    cout << (cc ? "Ya" : "Tidak") << ' ';
    cout << (dd ? "Ya" : "Tidak") << ' ';
    cout << '\n';
    return;
  }
  if ((a + b) % 2 == 0) {
    if (a == 0 && d == 0) {
      cc = 1;
      cout << (aa ? "Ya" : "Tidak") << ' ';
      cout << (bb ? "Ya" : "Tidak") << ' ';
      cout << (cc ? "Ya" : "Tidak") << ' ';
      cout << (dd ? "Ya" : "Tidak") << ' ';
      cout << '\n';
      return;
    } else {
      cc = 1;
      dd = 1;
      cout << (aa ? "Ya" : "Tidak") << ' ';
      cout << (bb ? "Ya" : "Tidak") << ' ';
      cout << (cc ? "Ya" : "Tidak") << ' ';
      cout << (dd ? "Ya" : "Tidak") << ' ';
      cout << '\n';
      return;
    }
  } else {
    if (a == 0 && d == 0) {
      bb = 1;
      cout << (aa ? "Ya" : "Tidak") << ' ';
      cout << (bb ? "Ya" : "Tidak") << ' ';
      cout << (cc ? "Ya" : "Tidak") << ' ';
      cout << (dd ? "Ya" : "Tidak") << ' ';
      cout << '\n';
      return;
    } else {
      aa = 1;
      bb = 1;
      cout << (aa ? "Ya" : "Tidak") << ' ';
      cout << (bb ? "Ya" : "Tidak") << ' ';
      cout << (cc ? "Ya" : "Tidak") << ' ';
      cout << (dd ? "Ya" : "Tidak") << ' ';
      cout << '\n';
      return;
    }
  }
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t = 1;
  cin >> t;
  while (t--) {
    testnum++;
    solve();
  }
}
