#include <bits/stdc++.h>
using namespace std;
inline int add(int _a, int _b) {
  if (_a < 0) {
    _a += 1000000007;
  }
  if (_b < 0) {
    _b += 1000000007;
  }
  if (_a + _b >= 1000000007) {
    return _a + _b - 1000000007;
  }
  return _a + _b;
}
inline int mul(int _a, int _b) {
  if (_a < 0) {
    _a += 1000000007;
  }
  if (_b < 0) {
    _b += 1000000007;
  }
  return ((long long int)((long long int)_a * (long long int)_b)) % 1000000007;
}
int a[10];
bool yes[10];
void solve() {
  int i, j;
  memset(yes, false, sizeof(yes));
  if (a[0] % 2 == 1 && a[1] % 2 == 0) {
    yes[0] = true;
    if (a[1] > 0 || a[2] > 0) {
      yes[1] = true;
    }
  }
  if (a[0] % 2 == 0 && a[1] % 2 == 1) {
    if (a[0] > 0 || a[3] > 0) yes[0] = true;
    yes[1] = true;
  }
  if (a[0] % 2 == 1 && a[1] % 2 == 1) {
    yes[2] = true, yes[3] = true;
  }
  if (a[0] % 2 == 0 && a[1] % 2 == 0) {
    if (a[1] > 0 || a[2] > 0) yes[2] = true;
    if (a[0] > 0 || a[3] > 0) yes[3] = true;
  }
  for (i = 0; i < 4; ++i) {
    if (i) printf(" ");
    if (yes[i])
      printf("%s", "Ya");
    else
      printf("%s", "Tidak");
  }
  puts("");
}
int main() {
  int cs, ts;
  scanf("%d", &ts);
  for (cs = 0; cs < ts; cs++) {
    scanf("%d %d", &a[0], &a[1]), scanf("%d %d", &a[2], &a[3]);
    solve();
  }
}
