T = int(input()) for _ in range(T): l = input().split() n = int(l[2]) ans = l[0] + " " + l[1] + " " + str(n+1) + " " + l[-1] print(ans)