import re t = int(input()) for _ in range(t): s = input().split() t = int(s[2]) + 1 print(s[0], s[1], t, s[3])