#include <bits/stdc++.h>
using namespace std;
void solution();
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  unsigned long long tc = 1;
  cin >> tc;
  for (unsigned long long t = 0; t < tc; ++t) solution();
  return 0;
}
void solution() {
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  if ((a + b) % 2 == 0) {
    cout << "Tidak Tidak ";
    if (b + c > 0)
      cout << "Ya ";
    else
      cout << "Tidak ";
    if (a + d > 0)
      cout << "Ya ";
    else
      cout << "Tidak ";
    cout << endl;
  } else {
    if (a + d > 0)
      cout << "Ya ";
    else
      cout << "Tidak ";
    if (b + c > 0)
      cout << "Ya ";
    else
      cout << "Tidak ";
    cout << "Tidak Tidak\n";
  }
}
