#include <bits/stdc++.h>
using namespace std;
long long sqr(long long a) { return a * a; }
const int N = 300001, M = 998244353;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int a, b, c, d, t;
  cin >> t;
  while (t--) {
    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" << endl;
      else
        cout << "Tidak" << endl;
    } else {
      if (a + d > 0)
        cout << "Ya ";
      else
        cout << "Tidak ";
      if (b + c > 0)
        cout << "Ya ";
      else
        cout << "Tidak ";
      cout << "Tidak "
           << "Tidak" << endl;
    }
  }
}
