n = int(input()) for i in range(n): s = input().split() print("{} {} {} {}".format(s[0],s[1],int(s[2])+1,s[3]))