for _ in [0]*int(input()):
    S=input().split()
    S[2]=str(int(S[2])+1)
    print(' '.join(S))