using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int NN => int.Parse(ReadLine()); static long[] NList => ReadLine().Split().Select(long.Parse).ToArray(); public static void Main() { Solve(); } static void Solve() { var t = NN; var ans = new string[t]; for (var u = 0; u < t; ++u) { var s = ReadLine().Split(); var n = int.Parse(s[2]); ans[u] = $"{s[0]} {s[1]} {n + 1} {s[3]}"; } WriteLine(string.Join("\n", ans)); } }