Chaneka has a hobby of playing with animal toys. Every toy has a different fun value, a real number. Chaneka has four boxes to store the toys with specification:   The first box stores toys with fun values in range of $(-\infty,-1]$.  The second box stores toys with fun values in range of $(-1, 0)$.  The third box stores toys with fun values in range of $(0, 1)$.  The fourth box stores toys with fun value in range of $[1, \infty)$. 

Chaneka has $A$, $B$, $C$, $D$ toys in the first, second, third, and fourth box, respectively. One day she decides that she only wants one toy, a super toy. So she begins to create this super toy by sewing all the toys she has.

While the number of toys Chaneka has is more than 1, she takes two different toys randomly and then sews them together, creating a new toy. The fun value of this new toy is equal to the multiplication of fun values of the sewn toys. She then puts this new toy in the appropriate box. She repeats this process until she only has one toy. This last toy is the super toy, and the box that stores this toy is the special box.

As an observer, you only know the number of toys in each box initially but do not know their fun values. You also don't see the sequence of Chaneka's sewing. Determine which boxes can be the special box after Chaneka found her super toy.


-----Input-----

The first line has an integer $T$ $(1 \le T \le 5 \cdot 10^4)$, the number of test cases.

Every case contains a line with four space-separated integers $A$ $B$ $C$ $D$ $(0 \le A, B, C, D \le 10^6, A + B + C + D > 0)$, which denotes the number of toys in the first, second, third, and fourth box, respectively.


-----Output-----

For each case, print four space-separated strings. Each string represents the possibility that the first, second, third, and fourth box can be the special box from left to right.

For each box, print "Ya" (Without quotes, Indonesian for yes) if that box can be the special box. Print "Tidak" (Without quotes, Indonesian for No) otherwise.


-----Example-----
Input
2
1 2 0 1
0 1 0 0

Output
Ya Ya Tidak Tidak
Tidak Ya Tidak Tidak



-----Note-----

For the first case, here is a scenario where the first box is the special box:   The first box had toys with fun values $\{-3\}$.  The second box had toys with fun values $\{ -0.5, -0.5 \}$  The fourth box had toys with fun values $\{ 3 \}$ 

The sewing sequence:   Chaneka sews the toy with fun $-0.5$ and $-0.5$ to a toy with fun $0.25$ and then put it in the third box.  Chaneka sews the toy with fun $-3$ and $0.25$ to a toy with fun $-0.75$ and then put it in the second box.  Chaneka sews the toy with fun $-0.75$ and $3$ to a toy with fun $-1.25$ and then put it in the first box, which then became the special box. 

Here is a scenario where the second box ends up being the special box:   The first box had toys with fun values $\{-3\}$  The second box had toys with fun values $\{ -0.33, -0.25 \}$.  The fourth box had toys with fun values $\{ 3 \}$. 

The sewing sequence:   Chaneka sews the toy with fun $-3$ and $-0.33$ to a toy with fun $0.99$ and then put it in the third box.  Chaneka sews the toy with fun $0.99$ and $3$ to a toy with fun $2.97$ and then put in it the fourth box.  Chaneka sews the toy with fun $2.97$ and $-0.25$ to a toy with fun $-0.7425$ and then put it in the second box, which then became the special box.  There is only one toy for the second case, so Chaneka does not have to sew anything because that toy, by definition, is the super toy.

Difficulty: EASY
Tags: Constructive algorithms

Starter code:

Solutions:
t = int(input())
while t > 0:
	t -= 1
	(a, b, c, d) = map(int, input().split(' '))
	l1 = ['Tidak'] * 4
	if (a + b) % 2 != 0:
		if a + d > 0:
			l1[0] = 'Ya'
		if b + c > 0:
			l1[1] = 'Ya'
	else:
		if a + d > 0:
			l1[3] = 'Ya'
		if b + c > 0:
			l1[2] = 'Ya'
	for i in l1:
		print(i, end=' ')
	print()


for _ in range(int(input())):
	(a, b, c, d) = [int(x) for x in input().split()]
	result = ['Ya' if a + d > 0 else 'Tidak', 'Ya' if b + c > 0 else 'Tidak']
	if (a + b) % 2 == 0:
		result = result[::-1]
		result[0:0] = ['Tidak', 'Tidak']
	else:
		result.extend(['Tidak', 'Tidak'])
	print(' '.join(result))


for _ in range(int(input())):
	(A, B, C, D) = map(int, input().split())
	ans = [0, 0, 0, 0]
	if (A + B) % 2 == 1:
		ans[3] = 'Tidak'
		ans[2] = 'Tidak'
		ans[1] = 'Ya'
		ans[0] = 'Ya'
		if A == 0:
			if D == 0:
				ans[0] = 'Tidak'
		elif B == 0:
			if C == 0:
				ans[1] = 'Tidak'
	elif (A + B) % 2 == 0:
		ans[3] = 'Ya'
		ans[2] = 'Ya'
		ans[1] = 'Tidak'
		ans[0] = 'Tidak'
		if D == 0:
			if A == 0:
				ans[3] = 'Tidak'
		if C == 0:
			if B == 0:
				ans[2] = 'Tidak'
	print(*ans)


for __ in range(int(input())):
	(A, B, C, D) = map(int, input().split())
	ai = bi = ci = di = 'Ya'
	if (A + B) % 2 == 1:
		ci = di = 'Tidak'
	else:
		ai = bi = 'Tidak'
	if A + D == 0:
		ai = di = 'Tidak'
	if B + C == 0:
		bi = ci = 'Tidak'
	print(ai, bi, ci, di)


test_cases = int(input())
for t in range(test_cases):
	box_1 = 'Tidak'
	box_2 = 'Tidak'
	box_3 = 'Tidak'
	box_4 = 'Tidak'
	toy_quantities = list(map(int, input().split()))
	neg_values = toy_quantities[0] + toy_quantities[1]
	big_values = toy_quantities[0] + toy_quantities[3]
	small_values = toy_quantities[1] + toy_quantities[2]
	if neg_values % 2 == 0:
		if big_values > 0:
			box_4 = 'Ya'
		if small_values > 0:
			box_3 = 'Ya'
	else:
		if big_values > 0:
			box_1 = 'Ya'
		if small_values > 0:
			box_2 = 'Ya'
	print(box_1 + ' ' + box_2 + ' ' + box_3 + ' ' + box_4)


k = int(input())
for _ in range(k):
	boxes = [int(i) for i in input().split()]
	res = ['Tidak', 'Tidak', 'Tidak', 'Tidak']
	if (boxes[0] + boxes[1]) % 2 == 1:
		if boxes[0] + boxes[3] > 0:
			res[0] = 'Ya'
		if boxes[2] + boxes[1] > 0:
			res[1] = 'Ya'
	else:
		if boxes[2] + boxes[1] > 0:
			res[2] = 'Ya'
		if boxes[0] + boxes[3] > 0:
			res[3] = 'Ya'
	for elem in res[:-1]:
		print(elem, end=' ')
	print(res[-1])


for _ in range(int(input())):
	(a, b, c, d) = [int(s) for s in input().split()]
	if a + d > 0:
		bigger = 1
	else:
		bigger = 0
	if b + c > 0:
		smaller = 1
	else:
		smaller = 0
	l = ['Tidak', 'Tidak']
	if smaller == 0:
		l.append('Tidak')
	else:
		l.append('Ya')
	if bigger == 0:
		l.append('Tidak')
	else:
		l.append('Ya')
	if (a + b) % 2 != 0:
		l = l[::-1]
	print(*l)


import math
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
n = int(input())
arr = []
for _ in range(n):
	(a, b, c, d) = list(map(int, input().split()))
	if (a + b) % 2 == 0:
		if b + c > 0 and a + d > 0:
			print('Tidak Tidak Ya Ya')
		elif b + c > 0 and a + d == 0:
			print('Tidak Tidak Ya Tidak')
		else:
			print('Tidak Tidak Tidak Ya')
	elif b + c > 0 and a + d > 0:
		print('Ya Ya Tidak Tidak')
	elif b + c > 0 and a + d == 0:
		print('Tidak Ya Tidak Tidak')
	else:
		print('Ya Tidak Tidak Tidak')


t = int(input(''))
for _ in range(t):
	[a, b, c, d] = list(map(int, input().split()))
	x = a + b & 1
	ans = []
	if x and a + d > 0:
		ans.append('Ya')
	else:
		ans.append('Tidak')
	if x and b + c > 0:
		ans.append('Ya')
	else:
		ans.append('Tidak')
	if x == 0 and b + c > 0:
		ans.append('Ya')
	else:
		ans.append('Tidak')
	if x == 0 and a + d > 0:
		ans.append('Ya')
	else:
		ans.append('Tidak')
	print(*ans)


for _ in range(int(input())):
	(a, b, c, d) = list(map(int, input().split()))
	if (a + b) % 2 == 0:
		if (b != 0 or c != 0) and (a != 0 or d != 0):
			print('Tidak Tidak Ya Ya')
		elif d != 0 or a != 0:
			print('Tidak Tidak Tidak Ya')
		elif b != 0 or c != 0:
			print('Tidak Tidak Ya Tidak')
	elif (b != 0 or c != 0) and (a != 0 or d != 0):
		print('Ya Ya Tidak Tidak')
	elif d != 0 or a != 0:
		print('Ya Tidak Tidak Tidak')
	elif b != 0 or c != 0:
		print('Tidak Ya Tidak Tidak')


for i in range(int(input())):
	(a, b, c, d) = [int(i) for i in input().split()]
	if a == 0 and d == 0:
		print('Tidak Ya Tidak Tidak' if b % 2 == 1 else 'Tidak Tidak Ya Tidak')
	elif b == 0 and c == 0:
		print('Ya Tidak Tidak Tidak' if a % 2 == 1 else 'Tidak Tidak Tidak Ya')
	else:
		print('Ya Ya Tidak Tidak' if (a + b) % 2 == 1 else 'Tidak Tidak Ya Ya')


from sys import stdout, stdin
from io import IOBase, BytesIO
from os import read, write, fstat
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = read(self._fd, max(fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self, size: int=...):
		while self.newlines == 0:
			b = read(self._fd, max(fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
(stdin, stdout) = (IOWrapper(stdin), IOWrapper(stdout))
input = lambda : stdin.readline().rstrip('\r\n')
t = int(input())
a = [None] * t
b = [None] * t
c = [None] * t
d = [None] * t
for i in range(0, t):
	(a[i], b[i], c[i], d[i]) = map(int, input().split())
	if (a[i] + b[i]) % 2 == 0:
		if (a[i], d[i]) == (0, 0):
			print('Tidak Tidak Ya Tidak')
		elif (b[i], c[i]) == (0, 0):
			print('Tidak Tidak Tidak Ya')
		else:
			print('Tidak Tidak Ya Ya')
	elif (a[i], d[i]) == (0, 0):
		print('Tidak Ya Tidak Tidak')
	elif (b[i], c[i]) == (0, 0):
		print('Ya Tidak Tidak Tidak')
	else:
		print('Ya Ya Tidak Tidak')


from sys import stdin

def get_ints():
	return list(map(int, stdin.readline().strip().split()))
for _ in range(int(input())):
	ar = get_ints()
	res = ['Tidak'] * 4
	bigs = ar[0] + ar[3]
	smalls = ar[1] + ar[2]
	if (ar[0] + ar[1]) % 2 == 1:
		if bigs > 0 and smalls > 0:
			res[0] = 'Ya'
			res[1] = 'Ya'
		elif bigs > 0 and (not smalls > 0):
			res[0] = 'Ya'
		else:
			res[1] = 'Ya'
	elif bigs > 0 and smalls > 0:
		res[2] = 'Ya'
		res[3] = 'Ya'
	elif bigs > 0 and (not smalls > 0):
		res[3] = 'Ya'
	else:
		res[2] = 'Ya'
	print(' '.join(res))


t = int(input())
for i in range(t):
	(a, b, c, d) = map(int, input().split())
	an = ['Tidak'] * 4
	if (a + b) % 2 == 0:
		if b == 0 and c == 0:
			an[3] = 'Ya'
		elif a == 0 and d == 0:
			an[2] = 'Ya'
		else:
			an[2] = 'Ya'
			an[3] = 'Ya'
	elif b == 0 and c == 0:
		an[0] = 'Ya'
	elif a == 0 and d == 0:
		an[1] = 'Ya'
	else:
		an[0] = 'Ya'
		an[1] = 'Ya'
	print(' '.join(an))


def toy(A, B, C, D):
	negativos = A + B
	if negativos % 2:
		if (A or D) and (B or C):
			return 'Ya Ya Tidak Tidak'
		elif not (B or C):
			return 'Ya Tidak Tidak Tidak'
		elif not (A or D):
			return 'Tidak Ya Tidak Tidak'
	elif (A or D) and (B or C):
		return 'Tidak Tidak Ya Ya'
	elif not (B or C):
		return 'Tidak Tidak Tidak Ya'
	elif not (A or D):
		return 'Tidak Tidak Ya Tidak'
test = int(input())
for i in range(test):
	(A, B, C, D) = list(map(int, input().split()))
	print(toy(A, B, C, D))


for k in range(int(input())):
	(a, b, c, d) = list(map(int, input().split()))
	s = ''
	if (a + b) % 2 == 1 and (a > 0 or d > 0):
		s += 'Ya '
	else:
		s += 'Tidak '
	if (a + b) % 2 == 1 and (b > 0 or c > 0):
		s += 'Ya '
	else:
		s += 'Tidak '
	if (a + b) % 2 == 0 and (b > 0 or c > 0):
		s += 'Ya '
	else:
		s += 'Tidak '
	if a > 0 and (a + b) % 2 == 0 or (d > 0 and (a + b) % 2 == 0):
		s += 'Ya'
	else:
		s += 'Tidak'
	print(s)


import sys, functools, collections, bisect, math, heapq
input = sys.stdin.readline
sys.setrecursionlimit(300000)
mod = 10 ** 9 + 7
t = int(input())
for _ in range(t):
	(a, b, c, d) = map(int, input().strip().split())
	ans = []
	if (a + b) % 2:
		if a or d:
			ans.append('Ya')
		else:
			ans.append('Tidak')
		if b or c:
			ans.append('Ya')
		else:
			ans.append('Tidak')
		ans.append('Tidak')
		ans.append('Tidak')
	else:
		ans.append('Tidak')
		ans.append('Tidak')
		if b or c:
			ans.append('Ya')
		else:
			ans.append('Tidak')
		if a or d:
			ans.append('Ya')
		else:
			ans.append('Tidak')
	print(' '.join(ans))


for elements in range(int(input())):
	[a, b, c, d] = list(map(int, input().split()))
	if (a + b) % 2 == 0 or a + b == 0:
		if b == 0 and c == 0:
			print('Tidak Tidak Tidak Ya')
			continue
		if a == 0 and d == 0:
			print('Tidak Tidak Ya Tidak')
			continue
		else:
			print('Tidak Tidak Ya Ya')
			continue
	else:
		if b == 0 and c == 0:
			print('Ya Tidak Tidak Tidak')
			continue
		if a == 0 and d == 0:
			print('Tidak Ya Tidak Tidak')
			continue
		else:
			print('Ya Ya Tidak Tidak')
			continue


def process():
	(a, b, c, d) = list(map(int, input().split()))
	if (a + b) % 2:
		if c + b > 0 and a + d == 0:
			print('Tidak Ya', end=' ')
		elif c + b == 0 and a + d > 0:
			print('Ya Tidak', end=' ')
		elif c + b > 0 and a + d > 0:
			print('Ya Ya', end=' ')
		print('Tidak Tidak')
	else:
		print('Tidak Tidak', end=' ')
		if d + a > 0 and c + b == 0:
			print('Tidak Ya')
		elif a + d == 0 and c + b > 0:
			print('Ya Tidak')
		elif d + a > 0 and c + b > 0:
			print('Ya Ya')

def main():
	for i in range(int(input())):
		process()
main()


t = int(input())
for _ in range(t):
	l = list(map(int, input().split()))
	a = [0] * 4
	if l[0] + l[3] != 0:
		a[0] = 1
		a[3] = 1
	if l[1] + l[2] != 0:
		a[1] = 1
		a[2] = 1
	if (l[1] + l[0]) % 2 == 0:
		a[0] = 0
		a[1] = 0
	else:
		a[2] = 0
		a[3] = 0
	for x in a:
		if x == 0:
			print('Tidak', end=' ')
		else:
			print('Ya', end=' ')
	print(' ')


import os, io
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
cases = int(input())
d1 = {1: 'Ya', 0: 'Tidak'}
for t in range(cases):
	out = [d1[1], d1[1], d1[1], d1[1]]
	(a, b, c, d) = list(map(int, input().split()))
	if (a + b) % 2 == 0:
		out[0] = d1[0]
		out[1] = d1[0]
		if b == 0 and c == 0:
			out[2] = d1[0]
		if a == 0 and d == 0:
			out[3] = d1[0]
	else:
		out[2] = d1[0]
		out[3] = d1[0]
		if d == 0 and a == 0:
			out[0] = d1[0]
		if c == 0 and b == 0:
			out[1] = d1[0]
	print(*out)


import sys, collections, operator
from functools import cmp_to_key
from collections import OrderedDict
from itertools import permutations
from math import sqrt

def get_inp():
	return sys.stdin.readline().strip()

def get_inps():
	return sys.stdin.readline().strip().split()

def println(str):
	return sys.stdout.write(str + '\n')

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
t = int(get_inp())
while t > 0:
	t -= 1
	(a, b, c, d) = map(int, get_inps())
	x = a + b
	if x % 2 != 0:
		if a + d > 0:
			print('Ya', end=' ')
		else:
			print('Tidak', end=' ')
	else:
		print('Tidak', end=' ')
	if x % 2 != 0:
		if c + b > 0:
			print('Ya', end=' ')
		else:
			print('Tidak', end=' ')
	else:
		print('Tidak', end=' ')
	if x % 2 == 0:
		if c + b > 0:
			print('Ya', end=' ')
		else:
			print('Tidak', end=' ')
	else:
		print('Tidak', end=' ')
	if x % 2 == 0:
		if a + d > 0:
			print('Ya', end=' ')
		else:
			print('Tidak', end=' ')
	else:
		print('Tidak', end=' ')
	print()


from sys import stdin, stdout
from collections import Counter
from itertools import permutations
import bisect
import math
I = lambda : map(int, stdin.readline().split())
I1 = lambda : stdin.readline()
for _ in range(int(I1())):
	l = list(I())
	(neg, pos) = (l[0] + l[1], l[2] + l[3])
	if sum(l) == 0:
		pass
	else:
		a = [0] * 4
		if l[0] == l[3] == 0:
			if l[1] % 2 == 0:
				a[2] = 1
			else:
				a[1] = 1
		elif l[1] == l[2] == 0:
			if l[0] % 2 == 0:
				a[3] = 1
			else:
				a[0] = 1
		elif neg % 2 != 0:
			a[0] = a[1] = 1
		else:
			a[2] = a[3] = 1
		for x in a:
			if x == 0:
				print('Tidak', end=' ')
			else:
				print('Ya', end=' ')
	print()


import math
test = int(input())
for _ in range(test):
	(a, b, c, d) = map(int, input().split())
	if (a + b) % 2 == 0:
		print('Tidak', 'Tidak', end=' ')
		if b >= 1 or c >= 1:
			print('Ya', end=' ')
		else:
			print('Tidak', end=' ')
		if a >= 1 or d >= 1:
			print('Ya', end=' ')
		else:
			print('Tidak', end=' ')
		print('')
	else:
		if a >= 1 or d >= 1:
			print('Ya', end=' ')
		else:
			print('Tidak', end=' ')
		if b >= 1 or c >= 1:
			print('Ya', end=' ')
		else:
			print('Tidak', end=' ')
		print('Tidak', 'Tidak', end=' ')
		print('')


t = int(input())
for you in range(t):
	l = input().split()
	a = int(l[0])
	b = int(l[1])
	c = int(l[2])
	d = int(l[3])
	z = a + b
	if z % 2 == 0:
		print('Tidak Tidak', end=' ')
		if b > 0 or c > 0:
			print('Ya', end=' ')
		else:
			print('Tidak', end=' ')
		if a > 0 or d > 0:
			print('Ya')
		else:
			print('Tidak')
	else:
		if a > 0 or d > 0:
			print('Ya', end=' ')
		else:
			print('Tidak', end=' ')
		if b > 0 or c > 0:
			print('Ya', end=' ')
		else:
			print('Tidak', end=' ')
		print('Tidak Tidak')


for i in range(int(input())):
	a = list(map(int, input().split()))
	if a[0] == 0 and a[3] == 0:
		if a[1] % 2 != 0:
			print('Tidak Ya Tidak Tidak')
		else:
			print('Tidak Tidak Ya Tidak')
	elif a[1] == 0 and a[2] == 0:
		if a[0] % 2 != 0:
			print('Ya Tidak Tidak Tidak')
		else:
			print('Tidak Tidak Tidak Ya')
	elif (a[0] + a[1]) % 2 == 0:
		print('Tidak Tidak Ya Ya')
	else:
		print('Ya Ya Tidak Tidak')


from collections import defaultdict
t = int(input())
for _ in range(t):
	inp = input().split(' ')
	inp = list(map(int, inp))
	ans = []
	for i in range(4):
		ans.append(0)
	if (inp[0] + inp[1]) % 2 != 0:
		if (inp[1] > 0 or inp[2] > 0) and (inp[0] > 0 or inp[3] > 0):
			ans[0] = 1
			ans[1] = 1
		elif inp[0] or inp[3]:
			ans[0] = 1
		else:
			ans[1] = 1
	elif (inp[1] > 0 or inp[2] > 0) and (inp[0] > 0 or inp[3] > 0):
		ans[2] = 1
		ans[3] = 1
	elif inp[0] or inp[3]:
		ans[3] = 1
	else:
		ans[2] = 1
	ans_str = ''
	for i in ans:
		if i:
			ans_str += 'Ya '
		else:
			ans_str += 'Tidak '
	print(ans_str)


for _ in range(int(input())):
	a = [int(i) for i in input().split()]
	res = ['Tidak'] * 4
	neg = a[0] + a[1]
	if neg % 2 == 0:
		if a[-4] != 0 or a[-1] != 0:
			res[-1] = 'Ya'
		if a[-3] != 0 or a[-2] != 0:
			res[-2] = 'Ya'
	else:
		if a[-4] != 0 or a[-1] != 0:
			res[-4] = 'Ya'
		if a[-3] != 0 or a[-2] != 0:
			res[-3] = 'Ya'
	print(*res, sep=' ')


t = int(input())
for q in range(t):
	(a, b, c, d) = map(int, input().split())
	if (a + b) % 2 == 1:
		if a > 0 or d > 0:
			print('Ya', end=' ')
		else:
			print('Tidak', end=' ')
		if b > 0 or c > 0:
			print('Ya', end=' ')
		else:
			print('Tidak', end=' ')
		print('Tidak Tidak')
	if (a + b) % 2 == 0:
		print('Tidak Tidak', end=' ')
		if b > 0 or c > 0:
			print('Ya', end=' ')
		else:
			print('Tidak', end=' ')
		if a > 0 or d > 0:
			print('Ya')
		else:
			print('Tidak')


def main():
	n = int(input())
	for _ in range(n):
		(a, b, c, d) = list(map(int, input().split()))
		if (a + b) % 2 == 0:
			if b + c == 0:
				print('Tidak Tidak Tidak Ya')
			elif a + d == 0:
				print('Tidak Tidak Ya Tidak')
			else:
				print('Tidak Tidak Ya Ya')
		elif b + c == 0:
			print('Ya Tidak Tidak Tidak')
		elif a + d == 0:
			print('Tidak Ya Tidak Tidak')
		else:
			print('Ya Ya Tidak Tidak')
main()


import heapq
import sys
from math import *
import threading
from heapq import *
from itertools import count
from pprint import pprint
from collections import defaultdict
from heapq import heapify, heappop, heappush
mod = 10 ** 9 + 7
inf = 10 ** 15
decision = ['NO', 'YES']
yes = 'YES'
no = 'NO'
import os
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD

	def npr(self, n, k):
		if k < 0 or n < k:
			return 0
		f = self.factorial
		return f.calc(n) * f.invFactorial(n - k) % self.MOD

class SegmentTree:

	def __init__(self, data, default=0, func=lambda a, b: max(a, b)):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

def lower_bound(li, num):
	answer = len(li)
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] >= num:
			answer = middle
			end = middle - 1
		else:
			start = middle + 1
	return answer

def upper_bound(li, num):
	answer = len(li)
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] <= num:
			start = middle + 1
		else:
			answer = middle
			end = middle - 1
	return answer

def abs(x):
	return x if x >= 0 else -x

def binary_search(li, val):
	ans = -1
	lb = 0
	ub = len(li) - 1
	while lb <= ub:
		mid = (lb + ub) // 2
		if li[mid] > val:
			ub = mid - 1
		elif val > li[mid]:
			lb = mid + 1
		else:
			ans = mid
			break
	return ans

def kadane(x):
	sum_so_far = 0
	current_sum = 0
	for i in x:
		current_sum += i
		if current_sum < 0:
			current_sum = 0
		else:
			sum_so_far = max(sum_so_far, current_sum)
	return sum_so_far

def pref(li):
	pref_sum = [0]
	for i in li:
		pref_sum.append(pref_sum[-1] + i)
	return pref_sum

def SieveOfEratosthenes(n):
	prime = [{1, i} for i in range(n + 1)]
	p = 2
	while p <= n:
		for i in range(p * 2, n + 1, p):
			prime[i].add(p)
		p += 1
	return prime

def primefactors(n):
	factors = []
	while n % 2 == 0:
		factors.append(2)
		n //= 2
	for i in range(3, int(sqrt(n)) + 1, 2):
		while n % i == 0:
			factors.append(i)
			n //= i
	if n > 2:
		factors.append(n)
	return factors

def prod(li):
	ans = 1
	for i in li:
		ans *= i
	return ans

def sumk(a, b):
	print('called for', a, b)
	ans = a * (a + 1) // 2
	ans -= b * (b + 1) // 2
	return ans

def sumi(n):
	ans = 0
	if len(n) > 1:
		for x in n:
			ans += int(x)
		return ans
	else:
		return int(n)

def checkwin(x, a):
	if a[0][0] == a[1][1] == a[2][2] == x:
		return 1
	if a[0][2] == a[1][1] == a[2][0] == x:
		return 1
	if len(set(a[0])) == 1 and a[0][0] == x or (len(set(a[1])) == 1 and a[1][0] == x) or (len(set(a[2])) == 1 and a[2][0] == x):
		return 1
	if len(set(a[0][:])) == 1 and a[0][0] == x or (len(set(a[1][:])) == 1 and a[0][1] == x) or (len(set(a[2][:])) == 1 and a[0][0] == x):
		return 1
	return 0
inf = 10 ** 9 + 7

def main():
	karmanya = int(input())
	while karmanya != 0:
		karmanya -= 1
		(a, b, c, d) = map(int, input().split())
		if a == 0 and d == 0:
			if b & 1 == 0:
				print('Tidak Tidak Ya Tidak')
			else:
				print('Tidak Ya Tidak Tidak')
		elif b == 0 and c == 0:
			if a & 1 == 0:
				print('Tidak Tidak Tidak Ya')
			else:
				print('Ya Tidak Tidak Tidak')
		elif a + b & 1 == 0:
			print('Tidak Tidak Ya Ya')
		else:
			print('Ya Ya Tidak Tidak')
main()


t = int(input())
for i in range(t):
	(A, B, C, D) = input().split()
	(A, B, C, D) = (int(A), int(B), int(C), int(D))
	if (A + B) % 2 == 0:
		if C == 0 and B == 0:
			print('Tidak', 'Tidak', 'Tidak', 'Ya')
		elif A == 0 and D == 0:
			print('Tidak', 'Tidak', 'Ya', 'Tidak')
		else:
			print('Tidak', 'Tidak', 'Ya', 'Ya')
	elif C == 0 and B == 0:
		print('Ya', 'Tidak', 'Tidak', 'Tidak')
	elif A == 0 and D == 0:
		print('Tidak', 'Ya', 'Tidak', 'Tidak')
	else:
		print('Ya', 'Ya', 'Tidak', 'Tidak')


try:
	t = int(input())
	for _ in range(t):
		(a, b, c, d) = map(int, input().split())
		if (a + b) % 2 and (a or d):
			print('Ya', end=' ')
		else:
			print('Tidak', end=' ')
		if (a + b) % 2 and (b or c):
			print('Ya', end=' ')
		else:
			print('Tidak', end=' ')
		if (a + b) % 2 == 0 and (b or c):
			print('Ya', end=' ')
		else:
			print('Tidak', end=' ')
		if (a + b) % 2 == 0 and (a or d):
			print('Ya', end=' ')
		else:
			print('Tidak', end=' ')
		print()
except EOFError:
	pass


t = int(input())
for i in range(t):
	(a, b, c, d) = map(int, input().split())
	if a + b + c + d == 1:
		lst = [a, b, c, d]
		for i in lst:
			if i == 0:
				print('Tidak', end=' ')
			else:
				print('Ya', end=' ')
		print()
	else:
		s1 = ''
		s2 = ''
		s3 = ''
		s4 = ''
		a1 = a + b
		if a1 % 2 == 0:
			if b + c > 0 and a + d > 0:
				s1 += 'Tidak'
				s2 += 'Tidak'
				s3 += 'Ya'
				s4 += 'Ya'
			elif b + c == 0:
				s1 += 'Tidak'
				s2 += 'Tidak'
				s3 += 'Tidak'
				s4 += 'Ya'
			else:
				s1 += 'Tidak'
				s2 += 'Tidak'
				s3 += 'Ya'
				s4 += 'Tidak'
		elif b + c > 0 and a + d > 0:
			s1 += 'Ya'
			s2 += 'Ya'
			s3 += 'Tidak'
			s4 += 'Tidak'
		elif b + c == 0:
			s1 += 'Ya'
			s2 += 'Tidak'
			s3 += 'Tidak'
			s4 += 'Tidak'
		else:
			s1 += 'Tidak'
			s2 += 'Ya'
			s3 += 'Tidak'
			s4 += 'Tidak'
		print(s1, s2, s3, s4)


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().strip().split(' '))

def msi():
	return map(str, input().strip().split(' '))

def li():
	return list(mi())

def dmain():
	sys.setrecursionlimit(1000000)
	threading.stack_size(1024000)
	thread = threading.Thread(target=main)
	thread.start()
import sys
input = sys.stdin.readline
scanner = lambda : int(input())
string = lambda : input().rstrip()
get_list = lambda : list(read())
read = lambda : map(int, input().split())
get_float = lambda : map(float, input().split())

def ceil(x):
	if x != int(x):
		x = int(x) + 1
	return x

def factorial(x, m):
	val = 1
	while x > 0:
		val = val * x % m
		x -= 1
	return val

def fact(x):
	val = 1
	while x > 0:
		val *= x
		x -= 1
	return val

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def lcm(a, b):
	return a * b // math.gcd(a, b)

def is_integer(n):
	return math.ceil(n) == math.floor(n)

def nCr(n, k):
	if k > n:
		return 0
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res)

def primefs(n):
	primes = {}
	while n % 2 == 0 and n > 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0 and n > 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	if y == 0:
		return 1
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	(prime[0], prime[1]) = (False, False)
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime

def phi(n):
	result = n
	p = 2
	while p * p <= n:
		if n % p == 0:
			while n % p == 0:
				n = n // p
			result = result * (1.0 - 1.0 / float(p))
		p = p + 1
	if n > 1:
		result = result * (1.0 - 1.0 / float(n))
	return int(result)

def is_prime(n):
	if n == 0:
		return False
	if n == 1:
		return True
	for i in range(2, int(n ** (1 / 2)) + 1):
		if not n % i:
			return False
	return True

def next_prime(n, primes):
	while primes[n] != True:
		n += 1
	return n
MAXN = int(100000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i
spf = [0 for i in range(MAXN)]

def factoriazation(x):
	res = []
	for i in range(2, int(x ** 0.5) + 1):
		while x % i == 0:
			res.append(i)
			x //= i
	if x != 1:
		res.append(x)
	return res

def factors(n):
	res = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			res.append(i)
			res.append(n // i)
	return list(set(res))

def int_array():
	return list(map(int, input().strip().split()))

def float_array():
	return list(map(float, input().strip().split()))

def str_array():
	return input().strip().split()

def binary_search(low, high, w, h, n):
	while low < high:
		mid = low + (high - low) // 2
		if check(mid, w, h, n):
			low = mid + 1
		else:
			high = mid
	return low

def check(moves, n):
	val = (moves + 1) // 2
	rem = moves - val
	sol = (val + 1) * (rem + 1)
	return sol < n

def sortSecond(val):
	return val[1]
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
alphs = 'abcdefghijklmnopqrstuvwxyz'
from itertools import permutations
import math
import bisect as bis
import random
import sys
import collections as collect
import functools as fnt
from decimal import Decimal

def solve():
	(a, b, c, d) = read()
	if (a + b) % 2 == 0:
		if b + c > 0 and a + d > 0:
			print('Tidak Tidak Ya Ya')
		elif b + c > 0:
			print('Tidak Tidak Ya Tidak')
		elif a + d > 0:
			print('Tidak Tidak Tidak Ya')
	elif b + c > 0 and a + d > 0:
		print('Ya Ya Tidak Tidak')
	elif b + c > 0:
		print('Tidak Ya Tidak Tidak')
	elif a + d > 0:
		print('Ya Tidak Tidak Tidak')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
t = scanner()
for i in range(t):
	solve()


for w in range(int(input())):
	(a, b, c, d) = tuple(map(int, input().split()))
	ans = [0] * 4
	q = [a, b, c, d]
	if q.count(1) == 1 and q.count(0) == 3:
		ans[q.index(1)] = 'Ya'
		for i in range(4):
			if ans[i] == 0:
				ans[i] = 'Tidak'
	else:
		if a % 2 != 0 and b % 2 == 0:
			ans[0] = 'Ya'
		elif a % 2 == 0 and b % 2 != 0:
			if a != 0:
				ans[0] = 'Ya'
			elif d > 0:
				ans[0] = 'Ya'
			else:
				ans[0] = 'Tidak'
		else:
			ans[0] = 'Tidak'
		if b % 2 != 0 and a % 2 == 0:
			ans[1] = 'Ya'
		elif b % 2 == 0 and a % 2 != 0:
			if b != 0:
				ans[1] = 'Ya'
			elif c > 0:
				ans[1] = 'Ya'
			else:
				ans[1] = 'Tidak'
		else:
			ans[1] = 'Tidak'
		if (a + b) % 2 == 0 and c > 0:
			ans[2] = 'Ya'
		elif (a + b) % 2 == 0:
			if b > 0 and (d > 0 or a > 0):
				ans[2] = 'Ya'
			elif b > 0 and b % 2 == 0:
				ans[2] = 'Ya'
			else:
				ans[2] = 'Tidak'
		else:
			ans[2] = 'Tidak'
		if (a + b) % 2 == 0 and d > 0:
			ans[3] = 'Ya'
		elif (a + b) % 2 == 0 and a > 0:
			ans[3] = 'Ya'
		else:
			ans[3] = 'Tidak'
	for i in range(4):
		print(ans[i], end=' ')
	print()


def sews(boxes: list):
	print('Ya', end=' ') if (boxes[0] + boxes[1]) % 2 != 0 and boxes[0] + boxes[3] > 0 else print('Tidak', end=' ')
	print('Ya', end=' ') if (boxes[0] + boxes[1]) % 2 != 0 and boxes[1] + boxes[2] > 0 else print('Tidak', end=' ')
	print('Ya', end=' ') if (boxes[0] + boxes[1]) % 2 == 0 and boxes[1] + boxes[2] > 0 else print('Tidak', end=' ')
	print('Ya') if (boxes[0] + boxes[1]) % 2 == 0 and boxes[0] + boxes[3] > 0 else print('Tidak')
for i in range(int(input())):
	sews(list(map(int, input().split(' '))))


def main(nTestCases):
	for i in range(nTestCases):
		yield specialBox_sPosition(*testCase_1425h())

def testCase_1425h():
	return map(int, input().split())

def specialBox_sPosition(nToysB1, nToysB2, nToysB3, nToysB4):
	if nToysB1 % 2 + nToysB2 % 2 == 1:
		if nToysB1 and nToysB2 or (nToysB1 and nToysB3) or (nToysB2 and nToysB4):
			return 'Ya Ya Tidak Tidak'
		elif nToysB1:
			return 'Ya Tidak Tidak Tidak'
		return 'Tidak Ya Tidak Tidak'
	if nToysB3 and nToysB4 or (nToysB1 and nToysB3) or (nToysB2 and nToysB4) or (nToysB1 and nToysB2):
		return 'Tidak Tidak Ya Ya'
	elif nToysB4 or nToysB1:
		return 'Tidak Tidak Tidak Ya'
	return 'Tidak Tidak Ya Tidak'
for answer in main(int(input())):
	print(answer)


import sys
input = sys.stdin.readline
I = lambda : list(map(int, input().split()))
(t,) = I()
for _ in range(t):
	(a, b, c, d) = I()
	an = ['Tidak'] * 4
	sig = -1 if a % 2 else 1
	ss = -1 if b % 2 else 1
	if sig * ss == -1 and (a or d):
		an[0] = 'Ya'
	if sig * ss == -1 and (b or c):
		an[1] = 'Ya'
	if sig * ss == 1 and (b or c):
		an[2] = 'Ya'
	if sig * ss == 1 and (a or d):
		an[3] = 'Ya'
	print(' '.join(an))


for _ in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	ans = ['', '', '', '']
	if (a + b) % 2 == 1:
		ans[2] = 'Tidak'
		ans[3] = 'Tidak'
		if a + d > 0 and b + c > 0:
			ans[0] = 'Ya'
			ans[1] = 'Ya'
		elif a + d == 0 and b + c > 0:
			ans[0] = 'Tidak'
			ans[1] = 'Ya'
		elif a + d > 0 and b + c == 0:
			ans[0] = 'Ya'
			ans[1] = 'Tidak'
	else:
		ans[0] = 'Tidak'
		ans[1] = 'Tidak'
		if a + d > 0 and b + c > 0:
			ans[2] = 'Ya'
			ans[3] = 'Ya'
		elif a + d == 0 and b + c > 0:
			ans[3] = 'Tidak'
			ans[2] = 'Ya'
		elif a + d > 0 and b + c == 0:
			ans[3] = 'Ya'
			ans[2] = 'Tidak'
	print(*ans)


for t in range(int(input())):
	a = list(map(int, input().split()))
	positive = 1 if (a[0] + a[1]) % 2 == 0 else 0
	if sum(a) == 0:
		print('Tidak Tidak Tidak Tidak')
	elif a[0] + a[3] > 0 and a[1] + a[2] > 0:
		if positive == 1:
			print('Tidak Tidak Ya Ya')
		else:
			print('Ya Ya Tidak Tidak')
	elif a[0] + a[3] > 0:
		if positive == 1:
			print('Tidak Tidak Tidak Ya')
		else:
			print('Ya Tidak Tidak Tidak')
	elif positive == 1:
		print('Tidak Tidak Ya Tidak')
	else:
		print('Tidak Ya Tidak Tidak')


t = int(input())
for _ in range(t):
	(a, b, c, d) = list(map(int, input().split()))
	possible = ['Ya', 'Ya', 'Ya', 'Ya']
	if (a + b) % 2 == 0:
		possible[0] = 'Tidak'
		possible[1] = 'Tidak'
	else:
		possible[2] = 'Tidak'
		possible[3] = 'Tidak'
	if a + d == 0:
		possible[0] = 'Tidak'
		possible[3] = 'Tidak'
	if b + c == 0:
		possible[1] = 'Tidak'
		possible[2] = 'Tidak'
	print(' '.join(possible))


def main():
	for _ in range(int(input())):
		(a, b, c, d) = [int(x) for x in input().split()]
		is_negative_sign = a + b & 1
		can_be_large = a or d
		can_be_small = b or c
		if is_negative_sign:
			print('Ya' if can_be_large else 'Tidak', end=' ')
			print('Ya' if can_be_small else 'Tidak', end=' ')
			print('Tidak Tidak')
		else:
			print('Tidak Tidak', end=' ')
			print('Ya' if can_be_small else 'Tidak', end=' ')
			print('Ya' if can_be_large else 'Tidak')
main()


import sys
input = sys.stdin.readline
from sys import stdin, stdout
from collections import defaultdict, Counter
M = 10 ** 9 + 7

def main():
	for _ in range(int(input())):
		(a, b, c, d) = [int(s) for s in input().split()]
		ans = ['Tidak'] * 4
		if (a + b) % 2 == 1:
			if a + d >= 1:
				ans[0] = 'Ya'
			if b + c >= 1:
				ans[1] = 'Ya'
		else:
			if a + d >= 1:
				ans[3] = 'Ya'
			if b + c >= 1:
				ans[2] = 'Ya'
		print(*ans)
main()


test = int(input())
while test:
	(a, b, c, d) = map(int, input().split())
	if a == 0 and d == 0:
		if b % 2 == 0:
			print('Tidak Tidak Ya Tidak')
		else:
			print('Tidak Ya Tidak Tidak')
	elif b == 0 and c == 0:
		if a % 2 == 0:
			print('Tidak Tidak Tidak Ya')
		else:
			print('Ya Tidak Tidak Tidak')
	elif (a + b) % 2 == 0:
		print('Tidak Tidak Ya Ya')
	else:
		print('Ya Ya Tidak Tidak')
	test -= 1


import sys, heapq, collections
tc = int(sys.stdin.readline())
for _ in range(tc):
	(a, b, c, d) = map(int, sys.stdin.readline().split())
	res = [-1, -1, 1, 1]
	if a % 2 == 0:
		res[0] = 1
	if b % 2 == 0:
		res[1] = 1
	ans = 1
	for i in res:
		ans *= i
	temp = ['Tidak'] * 4
	if ans == -1:
		if a != 0:
			temp[0] = 'Ya'
		if b != 0:
			temp[1] = 'Ya'
		if c != 0:
			temp[1] = 'Ya'
		if d != 0:
			temp[0] = 'Ya'
	else:
		if a != 0:
			temp[3] = 'Ya'
		if b != 0:
			temp[2] = 'Ya'
		if c != 0:
			temp[2] = 'Ya'
		if d != 0:
			temp[3] = 'Ya'
	print(' '.join(temp))


for i in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	(toya, toyb, toyc, toyd) = ('Tidak', 'Tidak', 'Tidak', 'Tidak')
	if (a + b) % 2 == 0:
		if c > 0 or b > 0:
			toyc = 'Ya'
		if a > 0 or d > 0:
			toyd = 'Ya'
	else:
		if c > 0 or b > 0:
			toyb = 'Ya'
		if a > 0 or d > 0:
			toya = 'Ya'
	print('{} {} {} {}'.format(toya, toyb, toyc, toyd))


def hi(a):
	if sum(a) == 1:
		p = a.index(1)
		b = ['Tidak'] * 4
		b[p] = 'Ya'
		return b
	p = (-1) ** (a[0] + a[1])
	b = [-2] * 4
	if p < 0:
		(b[2], b[3]) = ('Tidak', 'Tidak')
		if a[0] == 0 and a[3] == 0:
			(b[0], b[1]) = ('Tidak', 'Ya')
			return b
		if a[1] == 0 and a[2] == 0:
			(b[1], b[0]) = ('Tidak', 'Ya')
			return b
		else:
			(b[0], b[1]) = ('Ya', 'Ya')
			return b
	if p > 0:
		(b[0], b[1]) = ('Tidak', 'Tidak')
		if a[0] == 0 and a[3] == 0:
			(b[3], b[2]) = ('Tidak', 'Ya')
			return b
		if a[1] == 0 and a[2] == 0:
			(b[2], b[3]) = ('Tidak', 'Ya')
			return b
		else:
			(b[2], b[3]) = ('Ya', 'Ya')
			return b
t = int(input())
b = []
for i in range(t):
	a = list(map(int, input().split()))
	b.append(hi(a))
for i in range(len(b)):
	b[i] = ' '.join(b[i])
	print(b[i])


t = int(input())
for _ in range(t):
	(A, B, C, D) = map(int, input().split())
	if (A + B) % 2 == 0:
		if B + C > 0 and A + D > 0:
			print('Tidak Tidak Ya Ya')
		elif B + C > 0:
			print('Tidak Tidak Ya Tidak')
		elif A + D > 0:
			print('Tidak Tidak Tidak Ya')
	elif B + C > 0 and A + D > 0:
		print('Ya Ya Tidak Tidak')
	elif B + C > 0:
		print('Tidak Ya Tidak Tidak')
	elif A + D > 0:
		print('Ya Tidak Tidak Tidak')


from math import *
t = int(input())
for _ in range(t):
	(a, b, c, d) = map(int, input().split())
	ans = ['Tidak'] * 4
	if (a + b) % 2 == 0:
		if c > 0 or b > 0:
			ans[2] = 'Ya'
		if d > 0 or a > 0:
			ans[3] = 'Ya'
	else:
		if a > 0 or d > 0:
			ans[0] = 'Ya'
		if c > 0 or b > 0:
			ans[1] = 'Ya'
	print(*ans)


for i in range(int(input())):
	q = list(map(int, input().split()))
	w = ['Ya', 'Ya', 'Ya', 'Ya']
	if (q[0] + q[1]) % 2 == 0:
		w[0] = 'Tidak'
		w[1] = 'Tidak'
	else:
		w[2] = 'Tidak'
		w[3] = 'Tidak'
	if q[0] == 0 and q[3] == 0:
		w[0] = 'Tidak'
		w[3] = 'Tidak'
	if q[1] == 0 and q[2] == 0:
		w[1] = 'Tidak'
		w[2] = 'Tidak'
	print(*w)


for _ in range(int(input())):
	(a, b, c, d) = (True, True, True, True)
	(A, B, C, D) = list(map(int, input().split()))
	if (A + B) % 2 == 1:
		(c, d) = (False, False)
		if B + C > 0 and A + D > 0:
			pass
		elif A + D > 0 and B + C == 0:
			b = False
		else:
			a = False
	else:
		(a, b) = (False, False)
		if B + C > 0 and A + D > 0:
			pass
		elif A + D > 0 and B + C == 0:
			c = False
		else:
			d = False
	print('Ya ' if a == True else 'Tidak ', 'Ya ' if b == True else 'Tidak ', 'Ya ' if c == True else 'Tidak ', 'Ya ' if d == True else 'Tidak ')


def definearr(arr):
	aux = ['0', '0', '0', '0']
	if (arr[0] + arr[1]) % 2 == 0:
		if arr[0] + arr[3] > 0:
			aux[3] = '1'
		if arr[1] + arr[2] > 0:
			aux[2] = '1'
	if (arr[0] + arr[1]) % 2 == 1:
		if arr[0] + arr[3] > 0:
			aux[0] = '1'
		if arr[1] + arr[2] > 0:
			aux[1] = '1'
	retrn = ''
	for i in range(4):
		if aux[i] == '0':
			retrn += 'Tidak '
		else:
			retrn += 'Ya '
	return retrn

def main():
	n = int(input())
	for i in range(n):
		arr = [int(k) for k in input().split()]
		print(definearr(arr))
main()


(ok, no) = ('Ya', 'Tidak')
T = int(input())
for _ in range(T):
	(A, B, C, D) = map(int, input().split())
	answer = ['' for _ in range(4)]
	if (A + B) % 2 == 0:
		(answer[0], answer[1]) = (no, no)
		if B > 0 or C > 0:
			answer[2] = ok
			if A > 0 or D > 0:
				answer[3] = ok
			else:
				answer[3] = no
		else:
			answer[2] = no
			answer[3] = ok
	else:
		(answer[2], answer[3]) = (no, no)
		if B > 0 or C > 0:
			answer[1] = ok
			if A > 0 or D > 0:
				answer[0] = ok
			else:
				answer[0] = no
		else:
			answer[1] = no
			answer[0] = ok
	print(' '.join(answer))


t = int(input())
for _ in range(t):
	(a, b, c, d) = [int(x) for x in input().split()]
	ans = ['Tidak'] * 4
	if (a + b) % 2 == 0:
		if c + b > 0:
			ans[2] = 'Ya'
		if a + d > 0:
			ans[3] = 'Ya'
	else:
		if c + b > 0:
			ans[1] = 'Ya'
		if a + d > 0:
			ans[0] = 'Ya'
	print(*ans)


import sys
t = int(input())
for i in range(t):
	(a1, a2, a3, a4) = list(map(int, input().split()))
	neg = (a1 + a2) % 2 == 1
	large = a1 == 0 and a4 == 0
	small = a2 == 0 and a3 == 0
	(r1, r2, r3, r4) = (True, True, True, True)
	if neg:
		(r3, r4) = (False, False)
	else:
		(r1, r2) = (False, False)
	if large:
		(r1, r4) = (False, False)
	if small:
		(r2, r3) = (False, False)
	res = ''
	for j in [r1, r2, r3, r4]:
		if j:
			res += 'Ya '
		else:
			res += 'Tidak '
	print(res[:-1])


import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
t = int(input())
for _ in range(t):
	(a, b, c, d) = list(map(int, input().split()))
	x = a + d
	y = b + c
	z = a + b
	if x > 0 and y > 0:
		if z % 2 == 0:
			print('Tidak Tidak Ya Ya')
		else:
			print('Ya Ya Tidak Tidak')
	elif x > 0 and y == 0:
		if z % 2 == 0:
			print('Tidak Tidak Tidak Ya')
		else:
			print('Ya Tidak Tidak Tidak')
	elif x == 0 and y > 0:
		if z % 2 == 0:
			print('Tidak Tidak Ya Tidak')
		else:
			print('Tidak Ya Tidak Tidak')
	else:
		print('Tidak Tidak Tidak Tidak')


import math
t = int(input())
for _ in range(t):
	abcd = input().split()
	a = int(abcd[0])
	b = int(abcd[1])
	c = int(abcd[2])
	d = int(abcd[3])
	if a == 0 and d == 0:
		if b % 2 == 0:
			print('Tidak Tidak Ya Tidak')
		else:
			print('Tidak Ya Tidak Tidak')
	elif b == 0 and c == 0:
		if a % 2 == 0:
			print('Tidak Tidak Tidak Ya')
		else:
			print('Ya Tidak Tidak Tidak')
	elif (a + b) % 2 == 0:
		print('Tidak Tidak Ya Ya')
	else:
		print('Ya Ya Tidak Tidak')


for _ in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	r = []
	p = 0
	if (a + b) % 2 == 0:
		p = 0
	else:
		p = 1
	if p == 0:
		r.append('Tidak')
		r.append('Tidak')
		if b > 0 or c > 0:
			r.append('Ya')
		else:
			r.append('Tidak')
		if a > 0 or d > 0:
			r.append('Ya')
		else:
			r.append('Tidak')
	else:
		if a > 0 or d > 0:
			r.append('Ya')
		else:
			r.append('Tidak')
		if b > 0 or c > 0:
			r.append('Ya')
		else:
			r.append('Tidak')
		r.append('Tidak')
		r.append('Tidak')
	print(*r)


for test in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	ans = ['Tidak'] * 4
	if (a + b) % 2 == 0:
		if c + b > 0:
			ans[2] = 'Ya'
		if a + d > 0:
			ans[3] = 'Ya'
	else:
		if c + b > 0:
			ans[1] = 'Ya'
		if a + d > 0:
			ans[0] = 'Ya'
	print(*ans)


t = int(input())
for i in range(t):
	n = input().split()
	n = [int(_) for _ in n]
	zeros = [False, False, False, False]
	positive = True
	for j in range(4):
		if n[j] == 0:
			zeros[j] = True
	if (n[0] + n[1]) % 2 != 0:
		positive = False
	if positive:
		print('Tidak Tidak', end=' ')
		if zeros[1] and zeros[2]:
			print('Tidak', end=' ')
		else:
			print('Ya', end=' ')
		if zeros[0] and zeros[3]:
			print('Tidak')
		else:
			print('Ya')
	else:
		if zeros[0] and zeros[3]:
			print('Tidak', end=' ')
		else:
			print('Ya', end=' ')
		if zeros[1] and zeros[2]:
			print('Tidak', end=' ')
		else:
			print('Ya', end=' ')
		print('Tidak Tidak')


from collections import Counter
import string
import math
import bisect
import sys
from fractions import Fraction

def array_int():
	return [int(i) for i in sys.stdin.readline().split()]

def vary(arrber_of_variables):
	if arrber_of_variables == 1:
		return int(sys.stdin.readline())
	if arrber_of_variables >= 2:
		return map(int, sys.stdin.readline().split())

def makedict(var):
	return dict(Counter(var))
testcases = vary(1)
for _ in range(testcases):
	(a, b, c, d) = vary(4)
	if (a + b) % 2 != 0:
		(third, fourth) = ('Tidak', 'Tidak')
		if b > 0 or c > 0:
			second = 'Ya'
			if a > 0 or d > 0:
				first = 'Ya'
			else:
				first = 'Tidak'
		else:
			first = 'Ya'
			second = 'Tidak'
	else:
		(first, second) = ('Tidak', 'Tidak')
		if b > 0 or c > 0:
			third = 'Ya'
			if a > 0 or d > 0:
				fourth = 'Ya'
			else:
				fourth = 'Tidak'
		else:
			third = 'Tidak'
			fourth = 'Ya'
	print(first, second, third, fourth)


def solve(vals):
	pos_neg = (vals[0] + vals[1]) % 2
	if pos_neg == 0:
		if vals[2] == 0 and vals[1] == 0:
			return [3]
		elif vals[3] == 0 and vals[0] == 0:
			return [2]
		else:
			return [2, 3]
	elif vals[2] == 0 and vals[1] == 0:
		return [0]
	elif vals[3] == 0 and vals[0] == 0:
		return [1]
	else:
		return [0, 1]
for i in range(int(input(''))):
	inp = [int(a) for a in input('').split(' ')]
	res = solve(inp)
	prn = ''
	for j in range(4):
		if j in res:
			prn += 'Ya '
		else:
			prn += 'Tidak '
	print(prn)


T = int(input())
for i in range(T):
	toys = list(map(int, input().strip().split()))
	if toys[0] == 0 and toys[3] == 0:
		if toys[1] % 2 == 0:
			print('Tidak Tidak Ya Tidak')
		else:
			print('Tidak Ya Tidak Tidak')
	elif toys[1] == 0 and toys[2] == 0:
		if toys[0] % 2 == 0:
			print('Tidak Tidak Tidak Ya')
		else:
			print('Ya Tidak Tidak Tidak')
	elif (toys[0] + toys[1]) % 2 == 0:
		print('Tidak Tidak Ya Ya')
	else:
		print('Ya Ya Tidak Tidak')


def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s)])

def invr():
	return map(int, input().split())
n = inp()
for _ in range(n):
	l = inlt()
	if l[0] == 0 and l[1] == 0 and (l[2] == 0) and (l[3] == 0):
		print('Tidak Tidak Tidak Tidak')
	elif (l[0] + l[1]) % 2 == 1:
		if l[0] == 0 and l[3] == 0:
			print('Tidak Ya Tidak Tidak')
		elif l[1] == 0 and l[2] == 0:
			print('Ya Tidak Tidak Tidak')
		else:
			print('Ya Ya Tidak Tidak')
	elif l[0] == 0 and l[3] == 0:
		print('Tidak Tidak Ya Tidak')
	elif l[1] == 0 and l[2] == 0:
		print('Tidak Tidak Tidak Ya')
	else:
		print('Tidak Tidak Ya Ya')


t = int(input())
for _ in range(t):
	(a, b, c, d) = map(int, input().split())
	ans = [1, 1, 1, 1]
	if (a + b) % 2:
		ans[2:] = (0, 0)
		if not a and (not d):
			ans[0] = 0
		if not b and (not c):
			ans[1] = 0
	else:
		ans[:2] = (0, 0)
		if not a and (not d):
			ans[3] = 0
		if not b and (not c):
			ans[2] = 0
	for i in range(4):
		print('Ya' if ans[i] else 'Tidak', end=' ')
	print()


for i1 in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	if a + b & 1:
		if a or d:
			print('Ya ', end='')
		else:
			print('Tidak ', end='')
		if b or c:
			print('Ya ', end='')
		else:
			print('Tidak ', end='')
		print('Tidak Tidak')
	else:
		print('Tidak Tidak ', end='')
		if c or b:
			print('Ya ', end='')
		else:
			print('Tidak ', end='')
		if d or a:
			print('Ya ', end='')
		else:
			print('Tidak ', end='')
		print()


for _ in range(int(input())):
	arr = list(map(int, input().split()))
	ans = []
	if (arr[0] + arr[1]) % 2 != 0 and arr[0] + arr[3] > 0:
		ans.append('Ya')
	else:
		ans.append('Tidak')
	if (arr[0] + arr[1]) % 2 != 0 and arr[1] + arr[2] > 0:
		ans.append('Ya')
	else:
		ans.append('Tidak')
	if (arr[0] + arr[1]) % 2 == 0 and arr[1] + arr[2] > 0:
		ans.append('Ya')
	else:
		ans.append('Tidak')
	if (arr[0] + arr[1]) % 2 == 0 and arr[0] + arr[3] > 0:
		ans.append('Ya')
	else:
		ans.append('Tidak')
	print(*ans)


l = []
for _ in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	s = []
	if (a + b) % 2 == 0:
		s.append('Tidak Tidak')
		if b + c == 0:
			s.append('Tidak Ya')
		elif d != 0 or a != 0:
			s.append('Ya Ya')
		else:
			s.append('Ya Tidak')
	else:
		if b + c == 0:
			s.append('Ya Tidak')
		elif a == 0 and d == 0:
			s.append('Tidak Ya')
		else:
			s.append('Ya Ya')
		s.append('Tidak Tidak')
	l.append(' '.join(s))
for i in l:
	print(i)


t = int(input())
while t > 0:
	t = t - 1
	l = input().split()
	a = int(l[0])
	b = int(l[1])
	c = int(l[2])
	d = int(l[3])
	if a != 0:
		if (a + b) % 2 == 1:
			print('Ya', end=' ')
		else:
			print('Tidak', end=' ')
	elif d >= 1 and (a + b) % 2 == 1:
		print('Ya', end=' ')
	else:
		print('Tidak', end=' ')
	if b != 0:
		if (a + b) % 2:
			print('Ya', end=' ')
		else:
			print('Tidak', end=' ')
	elif c >= 1 and (a + b) % 2 == 1:
		print('Ya', end=' ')
	else:
		print('Tidak', end=' ')
	if c != 0:
		if (a + b) % 2 == 0:
			print('Ya', end=' ')
		else:
			print('Tidak', end=' ')
	elif b >= 1 and (a + b) % 2 == 0:
		print('Ya', end=' ')
	else:
		print('Tidak', end=' ')
	if d != 0:
		if (a + b) % 2 == 0:
			print('Ya', end=' ')
		else:
			print('Tidak', end=' ')
	elif a >= 1 and (a + b) % 2 == 0:
		print('Ya', end=' ')
	else:
		print('Tidak', end=' ')
	print()


import sys
t = int(input())
ans = [None] * 4
for tc in range(t):
	l = list(map(int, input().split()))
	if l[0] + l[1] & 1 == 1:
		ans[2] = 'Tidak'
		ans[3] = 'Tidak'
		if l[0] > 0 or l[3] > 0:
			ans[0] = 'Ya'
		else:
			ans[0] = 'Tidak'
		if l[1] > 0 or l[2] > 0:
			ans[1] = 'Ya'
		else:
			ans[1] = 'Tidak'
	else:
		ans[0] = 'Tidak'
		ans[1] = 'Tidak'
		if l[0] > 0 or l[3] > 0:
			ans[3] = 'Ya'
		else:
			ans[3] = 'Tidak'
		if l[1] > 0 or l[2] > 0:
			ans[2] = 'Ya'
		else:
			ans[2] = 'Tidak'
	for i in ans:
		print(i, end=' ')
	print()


import sys
for i in range(0, int(sys.stdin.readline())):
	l = list(map(int, sys.stdin.readline().split()))
	pm = sum(l[0:2]) % 2
	ico = 0
	if l[1] == 0 and l[2] == 0:
		ico = -1
	elif l[0] == 0 and l[3] == 0:
		ico = 1
	out = ''
	if ico != 1 and pm == 1:
		out += 'Ya '
	else:
		out += 'Tidak '
	if ico != -1 and pm == 1:
		out += 'Ya '
	else:
		out += 'Tidak '
	if ico != -1 and pm == 0:
		out += 'Ya '
	else:
		out += 'Tidak '
	if ico != 1 and pm == 0:
		out += 'Ya '
	else:
		out += 'Tidak '
	sys.stdout.write(out)
	sys.stdout.write('\n')


import sys
n = int(input())
for i in range(n):
	count = list(map(int, sys.stdin.readline().strip().split()))
	if (count[0] + count[1]) % 2:
		if count[1] + count[2] == 0:
			s = 'Ya Tidak Tidak Tidak'
		elif count[0] + count[3] == 0:
			s = 'Tidak Ya Tidak Tidak'
		else:
			s = 'Ya Ya Tidak Tidak'
	elif count[1] + count[2] == 0:
		s = 'Tidak Tidak Tidak Ya'
	elif count[0] + count[3] == 0:
		s = 'Tidak Tidak Ya Tidak'
	else:
		s = 'Tidak Tidak Ya Ya'
	sys.stdout.write(s + '\n')


t = int(input())
for case in range(t):
	(a, b, c, d) = [int(x) for x in input().split(' ')]
	x = []
	if (a + b) % 2 == 1:
		if max(a, d) > 0:
			x.append('Ya')
		else:
			x.append('Tidak')
		if max(b, c) > 0:
			x.append('Ya')
		else:
			x.append('Tidak')
		x.append('Tidak')
		x.append('Tidak')
	else:
		x.append('Tidak')
		x.append('Tidak')
		if max(b, c) > 0:
			x.append('Ya')
		else:
			x.append('Tidak')
		if max(a, d) > 0:
			x.append('Ya')
		else:
			x.append('Tidak')
	print(*x)


from sys import stdin
input = stdin.buffer.readline

def func():
	if a == 0 and d == 0:
		if b % 2 == 1:
			print('Tidak Ya Tidak Tidak')
		else:
			print('Tidak Tidak Ya Tidak')
	elif b == 0 and c == 0:
		if a % 2 == 1:
			print('Ya Tidak Tidak Tidak')
		else:
			print('Tidak Tidak Tidak Ya')
	elif (a + b) % 2 == 1:
		print('Ya Ya Tidak Tidak')
	else:
		print('Tidak Tidak Ya Ya')
for _ in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	func()


T = int(input())
x = 0
a = [[0] * 4] * T
while x != T:
	a[x] = [int(i) for i in input().split(' ')]
	x += 1
x = 0
while x != T:
	if a[x][1] == 0 and a[x][2] == 0 and (a[x][3] == 0):
		if a[x][0] % 2 == 1:
			print('Ya Tidak Tidak Tidak')
		else:
			print('Tidak Tidak Tidak Ya')
	elif a[x][0] == 0 and a[x][2] == 0 and (a[x][3] == 0):
		if a[x][1] % 2 == 1:
			print('Tidak Ya Tidak Tidak')
		else:
			print('Tidak Tidak Ya Tidak')
	elif a[x][0] == 0 and a[x][1] == 0 and (a[x][3] == 0):
		print('Tidak Tidak Ya Tidak')
	elif a[x][0] == 0 and a[x][1] == 0 and (a[x][2] == 0):
		print('Tidak Tidak Tidak Ya')
	elif a[x][0] == 0 and a[x][3] == 0:
		if a[x][1] % 2 == 1:
			print('Tidak Ya Tidak Tidak')
		else:
			print('Tidak Tidak Ya Tidak')
	elif (a[x][0] + a[x][1]) % 2 == 1:
		if a[x][1] == 0 and a[x][2] == 0:
			print('Ya Tidak Tidak Tidak')
		else:
			print('Ya Ya Tidak Tidak')
	elif a[x][1] == 0 and a[x][2] == 0:
		print('Tidak Tidak Tidak Ya')
	else:
		print('Tidak Tidak Ya Ya')
	x += 1


def solve():
	(a, b, c, d) = [int(x) for x in input().split(' ')]
	positive = True if (a + b) % 2 == 0 else False
	big = True if a != 0 or d != 0 else False
	small = True if b != 0 or c != 0 else False
	if positive:
		print('Tidak Tidak', end=' ')
		if small:
			print('Ya', end=' ')
		else:
			print('Tidak', end=' ')
		if big:
			print('Ya')
		else:
			print('Tidak')
	else:
		if big:
			print('Ya', end=' ')
		else:
			print('Tidak', end=' ')
		if small:
			print('Ya', end=' ')
		else:
			print('Tidak', end=' ')
		print('Tidak Tidak')
t = int(input())
for i in range(t):
	solve()


t = int(input())
for i in range(t):
	(a, b, c, d) = map(int, input().split())
	ans = ['Tidak', 'Tidak', 'Tidak', 'Tidak']
	if (a + b) % 2 == 1 and a + d > 0:
		ans[0] = 'Ya'
	if (a + b) % 2 == 1 and (a + d == 0 or b + c > 0):
		ans[1] = 'Ya'
	if (a + b) % 2 == 0 and (a + d == 0 or b + c > 0):
		ans[2] = 'Ya'
	if (a + b) % 2 == 0 and a + d > 0:
		ans[3] = 'Ya'
	print(' '.join(ans))


t = int(input())
for _ in range(t):
	(a, b, c, d) = [int(i) for i in input().split(' ')]
	sgn = (a + b) % 2
	small = False
	large = False
	if a == 0 and d == 0:
		small = True
	if b == 0 and c == 0:
		large = True
	okay = [True] * 4
	if sgn == 0:
		okay[0] = False
		okay[1] = False
	else:
		okay[2] = False
		okay[3] = False
	if small:
		okay[0] = False
		okay[3] = False
	if large:
		okay[1] = False
		okay[2] = False
	print(' '.join(['Ya' if okay[i] else 'Tidak' for i in range(4)]))


for ad in range(int(input())):
	(a, b, c, d) = list(map(int, input().split()))
	l = ['Tidak'] * 4
	x = a + d
	y = b + c
	if (a + b) % 2 == 0:
		if x != 0 and y != 0:
			l[2] = 'Ya'
			l[3] = 'Ya'
		elif x == 0 and y != 0:
			l[2] = 'Ya'
		else:
			l[3] = 'Ya'
	elif x != 0 and y != 0:
		l[1] = 'Ya'
		l[0] = 'Ya'
	elif x == 0 and y != 0:
		l[1] = 'Ya'
	else:
		l[0] = 'Ya'
	print(*l)


import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
for ad in range(int(input())):
	(a, b, c, d) = list(map(int, input().split()))
	l = ['Tidak'] * 4
	x = a + d
	y = b + c
	if (a + b) % 2 == 0:
		if x != 0 and y != 0:
			l[2] = 'Ya'
			l[3] = 'Ya'
		elif x == 0 and y != 0:
			l[2] = 'Ya'
		else:
			l[3] = 'Ya'
	elif x != 0 and y != 0:
		l[1] = 'Ya'
		l[0] = 'Ya'
	elif x == 0 and y != 0:
		l[1] = 'Ya'
	else:
		l[0] = 'Ya'
	print(*l)


import os
import sys
from io import BytesIO, IOBase
import math
from itertools import permutations
from decimal import Decimal, getcontext
getcontext().prec = 25
MOD = pow(10, 9) + 7
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
for _ in range(int(input())):
	ans = ['Tidak', 'Tidak', 'Tidak', 'Tidak']
	(a, b, c, d) = map(int, input().split(' '))
	if (a + b) % 2:
		if a or d:
			ans[0] = 'Ya'
		if b or c:
			ans[1] = 'Ya'
	else:
		if c or b:
			ans[2] = 'Ya'
		if d or a:
			ans[3] = 'Ya'
	print(*ans)


from sys import stdin, stdout
from collections import defaultdict
input = stdin.readline
for _ in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	(small, large, positive) = (0, 0, 1)
	if a > 0 or d > 0:
		large = 1
	if b > 0 or c > 0:
		small = 1
	if (a + b) % 2:
		positive = 0
	l = list()
	if large and (not positive):
		l.append('Ya')
	else:
		l.append('Tidak')
	if small and (not positive):
		l.append('Ya')
	else:
		l.append('Tidak')
	if small and positive:
		l.append('Ya')
	else:
		l.append('Tidak')
	if large and positive:
		l.append('Ya')
	else:
		l.append('Tidak')
	print(*l)


for _ in range(0, int(input())):
	(a, b, c, d) = list(map(int, input().split(' ')))
	ans = []
	if (a + b) % 2 == 0:
		ans.append('Tidak')
		ans.append('Tidak')
		if b > 0 or c > 0:
			ans.append('Ya')
		else:
			ans.append('Tidak')
		if d > 0 or a > 0:
			ans.append('Ya')
		else:
			ans.append('Tidak')
	if (a + b) % 2 == 1:
		if d > 0 or a > 0:
			ans.append('Ya')
		else:
			ans.append('Tidak')
		if c > 0 or b > 0:
			ans.append('Ya')
		else:
			ans.append('Tidak')
		ans.append('Tidak')
		ans.append('Tidak')
	for i in range(0, 3):
		print(ans[i], end=' ')
	print(ans[3])


for _ in range(int(input())):
	(a, b, c, d) = [int(x) for x in input().split()]
	res = [0] * 4
	if (a + b) % 2 == 0:
		res[2] = res[3] = 1
	else:
		res[0] = res[1] = 1
	if a > 0 or d > 0:
		res[0] += 1
		res[3] += 1
	if b > 0 or c > 0:
		res[1] += 1
		res[2] += 1
	print(*map(lambda r: 'Ya' if r == 2 else 'Tidak', res))


for _ in range(int(input())):
	(a, b, c, d) = list(map(int, input().split()))
	if (a + b) % 2 == 0:
		print('Tidak Tidak Tidak Ya' if b + c == 0 else 'Tidak Tidak Ya Tidak' if a + d == 0 else 'Tidak Tidak Ya Ya')
	else:
		print('Ya Tidak Tidak Tidak' if b + c == 0 else 'Tidak Ya Tidak Tidak' if a + d == 0 else 'Ya Ya Tidak Tidak')


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from itertools import *
import bisect
from heapq import *
from math import ceil, floor
from copy import *
from collections import deque, defaultdict
from collections import Counter as counter
from itertools import combinations
from itertools import permutations as permutate
from bisect import bisect_left as bl
from operator import *
from bisect import bisect_right as br
from bisect import bisect
BUFSIZE = 8192
from sys import stderr

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func
mod = 1000000007

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def fsep():
	return map(float, inp().split())

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def pow(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res
from functools import reduce

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

def gcd(a, b):
	if a == b:
		return a
	while b > 0:
		(a, b) = (b, a % b)
	return a

def prefix_sum(ar):
	return list(accumulate(ar))

def suffix_sum(ar):
	return list(accumulate(ar[::-1]))[::-1]

def N():
	return int(inp())
from collections import defaultdict

def numberOfSetBits(i):
	i = i - (i >> 1 & 1431655765)
	i = (i & 858993459) + (i >> 2 & 858993459)
	return ((i + (i >> 4) & 252645135) * 16843009 & 4294967295) >> 24

def solve():
	(a, b, c, d) = sep()
	ar = [0] * 4
	if (a + b) % 2 == 1:
		if a > 0 or d > 0:
			ar[0] = 1
		if b > 0 or c > 0:
			ar[1] = 1
	else:
		if a > 0 or d > 0:
			ar[3] = 1
		if b > 0 or c > 0:
			ar[2] = 1
	for i in ar:
		if i == 1:
			print('Ya', end=' ')
		else:
			print('Tidak', end=' ')
	print()
testcase(int(inp()))


for _ in range(int(input())):
	toys = list(map(int, input().split()))
	box = [0] * 4
	if sum(toys[0:2]) % 2 == 0:
		box[0] = 'Tidak'
		box[1] = 'Tidak'
		m = toys[0] or toys[3]
		n = toys[1] or toys[2]
		if m and n:
			box[2] = 'Ya'
			box[3] = 'Ya'
		elif m:
			box[3] = 'Ya'
			box[2] = 'Tidak'
		else:
			box[2] = 'Ya'
			box[3] = 'Tidak'
	else:
		box[2] = 'Tidak'
		box[3] = 'Tidak'
		m = toys[0] or toys[3]
		n = toys[1] or toys[2]
		if m and n:
			box[1] = 'Ya'
			box[0] = 'Ya'
		elif m:
			box[0] = 'Ya'
			box[1] = 'Tidak'
		else:
			box[1] = 'Ya'
			box[0] = 'Tidak'
	print(*box)


t = int(input())
for i in range(t):
	(a, b, c, d) = map(int, input().split())
	minus = a + b
	lsta = []
	if minus % 2 == 0:
		lsta.append('Tidak')
		lsta.append('Tidak')
		if c > 0 or b > 0:
			lsta.append('Ya')
		else:
			lsta.append('Tidak')
		if d > 0 or a > 0:
			lsta.append('Ya')
		else:
			lsta.append('Tidak')
	else:
		if d > 0 or a > 0:
			lsta.append('Ya')
		else:
			lsta.append('Tidak')
		if c > 0 or b > 0:
			lsta.append('Ya')
		else:
			lsta.append('Tidak')
		lsta.append('Tidak')
		lsta.append('Tidak')
	print(*lsta)


import sys
input = sys.stdin.buffer.readline
t = int(input())
for _ in range(t):
	(a, b, c, d) = [int(x) for x in input().split()]
	possible1 = ['Tidak', 'Tidak', 'Tidak', 'Tidak']
	negCnts = a + b
	posCnts = c + d
	if posCnts > 0 and negCnts % 2 == 0:
		possible1[2] = possible1[3] = 'Ya'
	if posCnts == 0 and (negCnts > 0 and negCnts % 2 == 0):
		possible1[2] = possible1[3] = 'Ya'
	if negCnts % 2 == 1:
		possible1[0] = possible1[1] = 'Ya'
	largerThan1cnts = a + d
	smallerThan1cnts = b + c
	possible2 = ['Tidak', 'Tidak', 'Tidak', 'Tidak']
	if largerThan1cnts > 0:
		possible2[0] = possible2[3] = 'Ya'
	if smallerThan1cnts > 0:
		possible2[1] = possible2[2] = 'Ya'
	possible3 = ['Tidak', 'Tidak', 'Tidak', 'Tidak']
	for i in range(4):
		if possible1[i] == possible2[i] == 'Ya':
			possible3[i] = 'Ya'
	print(' '.join(possible3))


import sys
input = sys.stdin.readline

def getInts():
	return [int(s) for s in input().split()]

def getInt():
	return int(input())

def getStrs():
	return [s for s in input().split()]

def getStr():
	return input().strip()

def listStr():
	return list(input().strip())
import collections as col
import math

def solve():
	(A, B, C, D) = getInts()
	(pos, neg) = (C + D, A + B)
	ans = ['Tidak'] * 4
	if max(B, C) > 0:
		ans[1] = 'Ya'
	if max(A, D) > 0:
		ans[0] = 'Ya'
	if neg % 2 == 0:
		ans.reverse()
	return ' '.join(ans)
for _ in range(getInt()):
	print(solve())


for t in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	y = 'Ya'
	n = 'Tidak'
	if a == 0 and c == 0 and (d == 0):
		if b % 2:
			print(n, y, n, n)
		else:
			print(n, n, y, n)
	elif b == 0 and c == 0 and (d == 0):
		if a % 2:
			print(y, n, n, n)
		else:
			print(n, n, n, y)
	elif a == 0 and b == 0 and (d == 0) and (c != 0):
		print(n, n, y, n)
	elif a == 0 and b == 0 and (c == 0) and (d != 0):
		print(n, n, n, y)
	elif a == 0 and d == 0 and (b != 0) and (c != 0):
		if b % 2:
			print(n, y, n, n)
		else:
			print(n, n, y, n)
	elif b == 0 and c == 0 and (a != 0) and (d != 0):
		if a % 2:
			print(y, n, n, n)
		else:
			print(n, n, n, y)
	elif (a + b) % 2:
		print(y, y, n, n)
	else:
		print(n, n, y, y)


import os
import sys
import math
from io import BytesIO, IOBase
from fractions import Fraction
import collections
from itertools import permutations
from collections import defaultdict
from collections import deque
import threading
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD
t = int(input())
while t:
	(a, b, c, d) = map(int, input().split())
	(w, x, y, z) = ('Tidak', 'Tidak', 'Tidak', 'Tidak')
	if (a + b) % 2 != 0:
		if a + d > 0:
			w = 'Ya'
		if b + c > 0:
			x = 'Ya'
	else:
		if a + d > 0:
			z = 'Ya'
		if b + c > 0:
			y = 'Ya'
	print(w, x, y, z)
	t -= 1


from sys import stdin, stdout
from math import floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque
from heapq import merge, heapify, heappop, heappush, nsmallest
from bisect import bisect_left as bl, bisect_right as br, bisect
mod = pow(10, 9) + 7
mod2 = 998244353

def inp():
	return stdin.readline().strip()

def out(var, end='\n'):
	stdout.write(str(var) + '\n')

def outa(*var, end='\n'):
	stdout.write(' '.join(map(str, var)) + end)

def lmp():
	return list(mp())

def mp():
	return map(int, inp().split())

def smp():
	return map(str, inp().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]

def remadd(x, y):
	return 1 if x % y else 0

def ceil(a, b):
	return (a + b - 1) // b

def isprime(x):
	if x <= 1:
		return False
	if x in (2, 3):
		return True
	if x % 2 == 0:
		return False
	for i in range(3, int(sqrt(x)) + 1, 2):
		if x % i == 0:
			return False
	return True
for _ in range(int(inp())):
	(a, b, c, d) = mp()
	if a == 0 and d == 0:
		if b % 2:
			print('Tidak Ya Tidak Tidak')
		else:
			print('Tidak Tidak Ya Tidak')
	elif b == 0 and c == 0:
		if a % 2:
			print('Ya Tidak Tidak Tidak')
		else:
			print('Tidak Tidak Tidak Ya')
	elif (a + b) % 2:
		print('Ya Ya Tidak Tidak')
	else:
		print('Tidak Tidak Ya Ya')


t = int(input())
for tc in range(t):
	(a, b, c, d) = map(int, input().split())
	k = ['Tidak'] * 4
	if not (a + b) % 2:
		if b + c:
			k[2] = 'Ya'
		if a + d:
			k[3] = 'Ya'
	else:
		if b + c:
			k[1] = 'Ya'
		if a + d:
			k[0] = 'Ya'
	print(*k)


for i in range(int(input())):
	a = input().split(' ')
	for j in range(4):
		a[j] = int(a[j])
	c1 = (a[0] + a[1]) % 2
	c2 = int(a[0] > 0 or a[3] > 0)
	c3 = int(a[1] > 0 or a[2] > 0)
	out = []
	if c1 and c2:
		out.append('Ya')
	else:
		out.append('Tidak')
	if c1 and c3:
		out.append('Ya')
	else:
		out.append('Tidak')
	if not c1 and c3:
		out.append('Ya')
	else:
		out.append('Tidak')
	if not c1 and c2:
		out.append('Ya')
	else:
		out.append('Tidak')
	print(' '.join(out))


t = int(input())
while t:
	(a, b, c, d) = map(int, input().split())
	(w, x, y, z) = ('Tidak', 'Tidak', 'Tidak', 'Tidak')
	if (a + b) % 2 != 0:
		if a + d > 0:
			w = 'Ya'
		if b + c > 0:
			x = 'Ya'
	else:
		if a + d > 0:
			z = 'Ya'
		if b + c > 0:
			y = 'Ya'
	print(w, x, y, z)
	t -= 1


cases = int(input())
d1 = {1: 'Ya', 0: 'Tidak'}
for t in range(cases):
	out = [1, 1, 1, 1]
	(a, b, c, d) = list(map(int, input().split()))
	if (a + b) % 2 == 0:
		out[0] = 0
		out[1] = 0
		if b == 0 and c == 0:
			out[2] = 0
		if a == 0 and d == 0:
			out[3] = 0
	else:
		out[2] = 0
		out[3] = 0
		if d == 0 and a == 0:
			out[0] = 0
		if c == 0 and b == 0:
			out[1] = 0
	print(*[d1[i] for i in out])


for _ in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	(p, q, r, s) = (0, 0, 0, 0)
	if b % 2 == 0:
		if b != 0:
			c = 1
		elif c != 0:
			c = 1
		b = 0
	else:
		b = 1
		c = 0
	if a % 2 == 0:
		if a != 0:
			d = 1
		elif d != 0:
			d = 1
		a = 0
	if a != 0:
		if b != 0:
			(r, s) = (1, 1)
		elif c != 0:
			(p, q) = (1, 1)
		else:
			p = 1
	elif b != 0:
		if d != 0:
			(p, q) = (1, 1)
		else:
			q = 1
	elif c != 0:
		if d != 0:
			(r, s) = (1, 1)
		else:
			r = 1
	elif d != 0:
		s = 1
	if p == 1:
		print('Ya', end=' ')
	else:
		print('Tidak', end=' ')
	if q == 1:
		print('Ya', end=' ')
	else:
		print('Tidak', end=' ')
	if r == 1:
		print('Ya', end=' ')
	else:
		print('Tidak', end=' ')
	if s == 1:
		print('Ya')
	else:
		print('Tidak')


t = int(input())
a = [None] * t
b = [None] * t
c = [None] * t
d = [None] * t
for i in range(0, t):
	(a[i], b[i], c[i], d[i]) = map(int, input().split())
	if (a[i] + b[i]) % 2 == 0:
		if (a[i], d[i]) == (0, 0):
			print('Tidak Tidak Ya Tidak')
		elif (b[i], c[i]) == (0, 0):
			print('Tidak Tidak Tidak Ya')
		else:
			print('Tidak Tidak Ya Ya')
	elif (a[i], d[i]) == (0, 0):
		print('Tidak Ya Tidak Tidak')
	elif (b[i], c[i]) == (0, 0):
		print('Ya Tidak Tidak Tidak')
	else:
		print('Ya Ya Tidak Tidak')