#include <bits/stdc++.h>
using namespace std;
const string S[] = {"Tidak", "Ya"};
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    int neg = (a + b) & 1;
    c += b;
    d += a;
    if (neg)
      cout << S[d > 0] << " " << S[c > 0] << " Tidak Tidak\n";
    else
      cout << "Tidak Tidak " << S[c > 0] << " " << S[d > 0] << "\n";
  }
  return 0;
}
