from sys import stdin N = int(input()) data = stdin.read() for d in data: tmp = d.split() print(tmp[0], tmp[1], int(tmp[2]) + 1, tmp[3])