------
## 最终结论
```python
def determine_special_box(T, test_cases):
    results = []
    for A, B, C, D in test_cases:
        result = ["Tidak", "Tidak", "Tidak", "Tidak"]
        
        # Check first box possibility
        if (A > 0 and (B % 2 == 0 or C > 0 or D > 0)) or (B % 2 == 1 and C > 0):
            result[0] = "Ya"
        
        # Check second box possibility
        if B > 0 or (A % 2 == 1 and D > 0) or (C % 2 == 1 and A > 0):
            result[1] = "Ya"
        
        # Check third box possibility
        if C > 0 or (A % 2 == 1 and B % 2 == 1) or (B % 2 == 1 and D > 0):
            result[2] = "Ya"
        
        # Check fourth box possibility
        if D > 0 and (B % 2 == 0 or C > 0 or A > 0):
            result[3] = "Ya"
        
        results.append(" ".join(result))
    
    return results

# Example usage:
T = int(input())
test_cases = [tuple(map(int, input().split())) for _ in range(T)]
results = determine_special_box(T, test_cases)
for result in results:
    print(result)
```