T = int(input()) for _ in range(T): S = input().split() print(S[0], S[1], int(S[2])+1, S[-1])