N = int(input()) ans = [] for _ in range(N): s = input().split() s[2] = str(int(s[2])+1) ans.append(s) for s in ans: print(" ".join(s))