t = int(input()) for i in range(t): line = list(map(str,input().split())) line_no = int(line[2]) print(line[0],line[1],line_no+1,line[3])