t = int(input()) for i in range(t): a,b,c,d = list(map(int, input().split())) f = 0 if a