You are given three positive integers $a$, $b$, $c$ ($a < b < c$). You have to find three positive integers $x$, $y$, $z$ such that:

$$x mod y = a,$$ $$y mod z = b,$$ $$z mod x = c.$$

Here $p mod q$ denotes the remainder from dividing $p$ by $q$. It is possible to show that for such constraints the answer always exists.


-----Input-----

The input consists of multiple test cases. The first line contains a single integer $t$ ($1 \le t \le 10000$) — the number of test cases. Description of the test cases follows.

Each test case contains a single line with three integers $a$, $b$, $c$ ($1 \le a < b < c \le 10^8$).


-----Output-----

For each test case output three positive integers $x$, $y$, $z$ ($1 \le x, y, z \le 10^{18}$) such that $x mod y = a$, $y mod z = b$, $z mod x = c$.

You can output any correct answer.


-----Examples-----

Input
4
1 3 4
127 234 421
2 7 8
59 94 388
Output
12 11 4
1063 234 1484
25 23 8
2221 94 2609


-----Note-----

In the first test case:

$$x mod y = 12 mod 11 = 1;$$

$$y mod z = 11 mod 4 = 3;$$

$$z mod x = 4 mod 12 = 4.$$

Source: codeforces | Difficulty: EASY
Tags: Mathematics

Constructive algorithms


Solutions:
import sys
input = sys.stdin.readline
n = int(input())
for _ in range(n):
	(a, b, c) = [int(i) for i in input().split(' ')]
	x = a + b + c
	y = b + c
	z = c
	print(f'{x} {y} {z}')


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	if a >= b and a >= c:
		print(a, a + b + c, a + c)
	elif b >= a and b >= c:
		print(a + b, b, a + b + c)
	else:
		print(a + b + c, b + c, c)


t = int(input())
out = ''
for _ in range(t):
	(a, b, c) = [int(x) for x in input().split()]
	out += str(c + b + a) + ' ' + str(c + b) + ' ' + str(c) + '\n'
print(out)


n = int(input())
ret = ''
for i in range(n):
	(a, b, c) = [int(k) for k in input().split(' ')]
	ret += str(a + b + c) + ' ' + str(b + c) + ' ' + str(c) + '\n'
print(ret)


import sys

def mingidit(i):
	digits = list(str(i))
	if len(digits) == 2:
		return int(digits[-1])
	return int(min(digits))

def ZXC(a, b, c):
	return [a + b + c, c + b, c]
r = int(sys.stdin.readline())
for j in range(r):
	(a, b, c) = [int(x) for x in sys.stdin.readline().split()]
	print(' '.join([str(x) for x in ZXC(a, b, c)]))


import math as m
i = input()
inp = []
for a in range(0, int(i)):
	inp += [input()]
for s in inp:
	arr = [int(n) for n in s.split()]
	print(str(arr[0] + arr[1] + arr[2]) + ' ' + str(arr[1] + arr[2]) + ' ' + str(arr[2]))


import sys, math

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def get_ls():
	return list(map(int, sys.stdin.readline().strip().split()))

def main():
	for _ in range(int(input())):
		(a, b, c) = get_ints()
		x = a + b + c
		y = b + c
		z = c
		print(x, y, z)
main()


import sys
for i in range(int(sys.stdin.readline())):

	def get_ints():
		return map(int, sys.stdin.readline().strip().split())

	def single_ints():
		return int(sys.stdin.readline())

	def p(a):
		return sys.stdout.write(a)
	(a, b, c) = get_ints()
	z = c
	y = b + z
	x = y + a
	p(str(x) + ' ' + str(y) + ' ' + str(z) + '\n')


import sys
t = int(sys.stdin.readline())
for i in range(t):
	(a, b, c) = map(int, sys.stdin.readline().split())
	z = c
	y = z + b
	x = y + a
	sys.stdout.write(str(x) + ' ' + str(y) + ' ' + str(z) + '\n')


from sys import stdin
from math import log, floor, ceil, gcd
input = stdin.readline
inp = lambda : int(stdin.readline())

def ra(typ):
	return list(map(typ, stdin.readline().split()))

def rv(typ):
	return map(typ, stdin.readline().split())

def main():
	for _ in range(inp()):
		(a, b, c) = rv(int)
		z = c
		y = b + c
		x = a + b + c
		print(x, y, z)
main()


t = int(input())
r = []
for i in range(t):
	n = input()
	(a, b, c) = [int(j) for j in n.split()]
	z = c
	y = z + b
	x = y + a
	r.append(f'{x} {y} {z}')
for i in r:
	print(i)


import sys

def get_ints():
	return list(map(int, sys.stdin.readline().strip().split()))
t = int(sys.stdin.readline())
arr = []
for n in range(t):
	arr.append(get_ints())
for n in range(t):
	z = arr[n][2]
	y = z + arr[n][1]
	x = y + arr[n][0]
	sys.stdout.write('{} {} {}\n'.format(x, y, z))


for s in [*open(0)][1::1]:
	(a, b, c) = map(int, s.split())
	z = (b + c - 1) // c * c
	print(z + b + a, z + b, z)


import sys
import bisect
import math
import itertools

def get_line():
	return list(map(int, sys.stdin.readline().strip().split()))

def in1():
	return int(input())
for _ in range(in1()):
	(a, b, c) = get_line()
	z = c
	y = b + z
	x = y + a
	print(x, y, z)


import sys
input = sys.stdin.readline
tcs = int(input().strip())
for tc in range(tcs):
	(a, b, c) = tuple(map(int, input().split()))
	print(a + b + c, b + c, c)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	Z = c
	Y = Z + b
	X = Y + a
	print(X, Y, Z)


import sys
input = sys.stdin.readline

def solve():
	(a, b, c) = map(int, input().split())
	(x, y, z) = (a + b + c, b + c, c)
	return (x, y, z)
for _ in range(int(input())):
	print(*solve())


from collections import Counter
from math import ceil, floor, log, gcd
import bisect as bs
import sys
input = sys.stdin.readline
inp_lis = lambda : list(map(int, input().split()))
inp_multi = lambda : map(int, input().split())
inp_int = lambda : int(input().strip())
for _ in range(int(input().strip())):
	(a, b, c) = inp_multi()
	print(a + b + c, b + c, c, sep=' ')


import os.path
from math import gcd, floor, ceil
from collections import *
import sys
mod = 1000000007
INF = float('inf')

def st():
	return list(sys.stdin.readline().strip())

def li():
	return list(map(int, sys.stdin.readline().split()))

def mp():
	return map(int, sys.stdin.readline().split())

def inp():
	return int(sys.stdin.readline())

def pr(n):
	return sys.stdout.write(str(n) + '\n')

def prl(n):
	return sys.stdout.write(str(n) + ' ')
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
t = inp()
for i in range(t):
	(a, b, c) = mp()
	s = a + b + c
	print(s, s - a, s - a - b)


import sys
input = lambda : sys.stdin.readline().strip()
a = int(input())
for i in range(a):
	(a, b, c) = list(map(int, input().split()))
	print(a + b + c, c + b, c)


lis = []
for i in range(int(input())):
	(a, b, c) = map(int, input().split(' '))
	z = c
	y = b + c
	x = a + y
	d = str(x) + ' ' + str(y) + ' ' + str(z)
	lis.append(d)
print(*lis, sep='\n')


import sys
n = int(sys.stdin.readline())
for _ in range(n):
	(a, b, c) = map(int, sys.stdin.readline().split())
	(x, y, z) = (a + b + c, b + c, c)
	print(x, y, z)


def z_mod_x():
	n = int(input())
	w_lst = []
	for i in range(n):
		lst = []
		(a, b, c) = map(int, input().split())
		lst.append(a + b + c)
		lst.append(b + c)
		lst.append(c)
		w_lst.append(lst)
	for ele in w_lst:
		for i in ele:
			print(i, end=' ')
		print()
z_mod_x()


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(a, b, c) = list(map(int, input().split()))
	print(a + b + c, b + c, c)


import sys
LI = lambda : list(map(int, sys.stdin.readline().split()))
for i in range(int(input())):
	numbers = LI()
	sorted(numbers)
	num1 = numbers[0]
	num2 = numbers[1]
	num3 = numbers[2]
	print(sum(numbers), end=' ')
	print(num3 + num2, end=' ')
	print(num3)


n = int(input())
a = []
for i in range(n):
	a.append(input().split(' '))
for arr in a:
	a = int(arr[0])
	b = int(arr[1])
	c = int(arr[2])
	print(a + b + c, b + c, c)


t = int(input())
A = []
for i in range(t):
	A.append(list(map(int, input().split())))
for i in A:
	i.sort()
	(a, b, c) = (i[0], i[1], i[2])
	print(a + b + c, b + c, c)


def sol(a, b, c):
	x = a + b + c
	y = b + c
	z = c
	res = []
	res.append(x)
	res.append(y)
	res.append(z)
	return res

def solution():
	t = int(input())
	output = []
	for i in range(t):
		buf = input().split()
		a = int(buf[0])
		b = int(buf[1])
		c = int(buf[2])
		output.append(sol(a, b, c))
	print()
	for i in range(t):
		print(output[i][0], output[i][1], output[i][2])
solution()


n = int(input())
tests = []
for _ in range(n):
	tests.append(list(map(int, input().split())))
for m in tests:
	z = m[2]
	y = z + m[1]
	x = y + m[0]
	print(x, y, z)


n = int(input())
A = []
for i in range(n):
	arr = list(map(int, input().split()))
	A.append(arr)
for i in A:
	x = i[0] + i[1] + i[2]
	y = i[1] + i[2]
	z = i[2]
	print(str(x) + ' ' + str(y) + ' ' + str(z))


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(A, B, C) = list(map(int, input().split()))
	print(A + B + C, C + B, C)


n = input()
test_cases = []
for i in range(0, int(n)):
	test_cases.append(input().split())
for k in test_cases:
	print(int(k[0]) + int(k[1]) + int(k[2]), int(k[1]) + int(k[2]), int(k[2]))


n = int(input())
arr = []
for i in range(n):
	arr.append(list(map(int, input().split())))
for j in arr:
	(a, b, c) = (j[0], j[1], j[2])
	x = a + b + c
	y = b + c
	z = c
	print(x, y, z)


import math
from itertools import permutations
t = int(input(''))
LIST = []
for i in range(t):
	line = list(map(int, input().split()))
	LIST.append(line)
for numbers in LIST:
	a = numbers[0]
	b = numbers[1]
	c = numbers[2]
	x = a + b + c
	y = b + c
	z = c
	print(x, y, z)


for _ in range(int(input())):
	(a, b, c) = [int(x) for x in input().split()]
	print(f'{c + b + a} {c + b} {c}')


t = int(input())
while t > 0:
	t -= 1
	(a, b, c) = [int(x) for x in input().split(' ')]
	print(f'{a + b + c} {b + c} {c}')


for i in range(int(input())):
	(a, b, c) = map(int, str.split(input()))
	print(str(a + b + c) + ' ' + str(b + c) + ' ' + str(c))


for i in range(int(input())):
	(a, b, c) = list(map(int, input().split()))
	x = a + b + c
	y = b + c
	z = c
	print(str(x) + ' ' + str(y) + ' ' + str(z))


t = int(input())
for i in range(t):
	(a, b, c) = map(int, input().split())
	print('{} {} {}'.format(a + b + c, b + c, c))


for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	print('%d %d %d' % (a + b + c, b + c, c))


for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	ans = []
	ans.append(str(a + b + c))
	ans.append(str(b + c))
	ans.append(str(c))
	print(' '.join(ans))


for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	(x, y, z) = (a + b + c, b + c, c)
	print(f'{x} {y} {z}')


t = int(input())
for _ in range(t):
	(a, b, c) = input().split()
	(a, b, c) = (int(a), int(b), int(c))
	z = c
	y = z + b
	x = y + a
	print('%d %d %d' % (x, y, z))


t = int(input())
for _ in range(t):
	(a, b, c) = list(map(int, input().strip().split()))
	print('{} {} {}'.format(a + b + c, b + c, c))


n = int(input())
for i in range(n):
	(a, b, c) = tuple(map(int, input().split()))
	print(f'{a + b + c} {b + c} {c}')


def sol(a, b, c):
	z = c
	y = z + b
	x = y + a
	return str(x) + ' ' + str(y) + ' ' + str(z)
t = int(input())
for _ in range(t):
	(a, b, c) = map(int, input().split())
	print(sol(a, b, c))