#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    bool positive = ((a + b) % 2 == 0);
    bool deci_val = (b + c > 0);
    bool full_val = (a + d > 0);
    if (full_val && not positive)
      cout << "Ya ";
    else
      cout << "Tidak ";
    if (deci_val && not positive)
      cout << "Ya ";
    else
      cout << "Tidak ";
    if (deci_val && positive)
      cout << "Ya ";
    else
      cout << "Tidak ";
    if (full_val && positive)
      cout << "Ya ";
    else
      cout << "Tidak ";
    cout << '\n';
  }
  return 0;
}
