#include <bits/stdc++.h>
using namespace std;
void im_mortal() {
  long long e;
  cin >> e;
  while (e--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a % 2 != b % 2 && (a > 0 || d > 0))
      cout << "Ya ";
    else
      cout << "Tidak ";
    if (a % 2 != b % 2 && (b > 0 || c > 0))
      cout << "Ya ";
    else
      cout << "Tidak ";
    if (a % 2 == b % 2 && (b > 0 || c > 0))
      cout << "Ya ";
    else
      cout << "Tidak ";
    if (a % 2 == b % 2 && (a > 0 || d > 0))
      cout << "Ya ";
    else
      cout << "Tidak ";
    cout << endl;
  }
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  im_mortal();
  return 0;
}
