n = int(input()) for i in range(n): s = input().split() a = int(s[2]) s[2] = str(a + 1) print(" ".join(s))