You are given three integers $a \le b \le c$.

In one move, you can add $+1$ or $-1$ to any of these integers (i.e. increase or decrease any number by one). You can perform such operation any (possibly, zero) number of times, you can even perform this operation several times with one number. Note that you cannot make non-positive numbers using such operations.

You have to perform the minimum number of such operations in order to obtain three integers $A \le B \le C$ such that $B$ is divisible by $A$ and $C$ is divisible by $B$.

You have to answer $t$ independent test cases. 


-----Input-----

The first line of the input contains one integer $t$ ($1 \le t \le 100$) — the number of test cases.

The next $t$ lines describe test cases. Each test case is given on a separate line as three space-separated integers $a, b$ and $c$ ($1 \le a \le b \le c \le 10^4$).


-----Output-----

For each test case, print the answer. In the first line print $res$ — the minimum number of operations you have to perform to obtain three integers $A \le B \le C$ such that $B$ is divisible by $A$ and $C$ is divisible by $B$. On the second line print any suitable triple $A, B$ and $C$.


-----Example-----
Input
8
1 2 3
123 321 456
5 10 15
15 18 21
100 100 101
1 22 29
3 19 38
6 30 46

Output
1
1 1 3
102
114 228 456
4
4 8 16
6
18 18 18
1
100 100 100
7
1 22 22
2
1 19 38
8
6 24 48

Difficulty: EASY

Solutions:
import math
import collections
import bisect
import heapq
import time
import random
import itertools
import sys
from typing import List

def sove(A, B, C):
	ans = A + B
	(xa, xb, xc) = (A, B, C)
	for a in range(1, C + 1):
		sa = abs(A - a)
		if sa >= ans:
			continue
		k = ans - sa
		(xl, xr) = (max(max(B - k, 1) // a, 1), (B + k) // a + 1)
		for dx in range(xl, xr + 1):
			b = dx * a
			sb = sa + abs(b - B)
			if sb >= ans:
				continue
			k = ans - sb
			(yl, yr) = (max(max(C - k, 1) // b, 1), (C + k) // b + 1)
			for dy in range(yl, yr + 1):
				c = dy * b
				sc = sb + abs(c - C)
				if sc < ans:
					ans = sc
					(xa, xb, xc) = (a, b, c)
	return (ans, xa, xb, xc)
T = int(input())
for ti in range(T):
	(A, B, C) = map(int, input().split())
	(step, a, b, c) = sove(A, B, C)
	print(step)
	print('{} {} {}'.format(a, b, c))


n = int(input())
for _ in range(n):
	mini = 100000000
	(a, b, c) = map(int, input().split())
	(a1, b1, c1) = (0, 0, 0)
	for i in range(1, 2 * a + 2):
		for j in range(i, 2 * b + 2, i):
			for k in range(2):
				y = c // j * j + j * k
				if abs(a - i) + abs(b - j) + abs(c - y) < mini:
					mini = abs(a - i) + abs(b - j) + abs(c - y)
					a1 = i
					b1 = j
					c1 = y
	print(mini)
	print(a1, b1, c1)


from collections import Counter
from collections import defaultdict
import math
t = int(input())
for _ in range(0, t):
	(a, b, c) = list(map(int, input().split()))
	i = 1
	ans = 9999999
	stop1 = 999999
	pairs = [0, 0, 0]
	while i < 10001:
		j = i
		while j < 10510:
			k = j
			stop1 = 9999999
			while k < 10500:
				diff = abs(a - i) + abs(b - j) + abs(c - k)
				if stop1 < diff:
					break
				stop1 = diff
				if diff < ans:
					stop = diff
					ans = diff
					pairs = [i, j, k]
				k = k + j
			j = j + i
		i = i + 1
	print(ans)
	print(*pairs)


for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	ans = 100000000000
	aa = 0
	bb = 0
	cc = 0
	for i in range(1, 11000):
		for j in range(i, 11000, i):
			for k in range(j, 11000, j):
				if j % i == 0 and k % j == 0:
					m = abs(a - i) + abs(b - j) + abs(c - k)
					if m < ans:
						aa = i
						bb = j
						cc = k
						ans = m
						if ans == 0:
							break
			if ans == 0:
				break
		if ans == 0:
			break
	print(ans)
	print(aa, bb, cc)


import sys
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep='\n')

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

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

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

def LLI(rows_number):
	return [LI() for _ in range(rows_number)]

def SI():
	return sys.stdin.readline()[:-1]

def main():
	t = II()
	for _ in range(t):
		(a, b, c) = MI()
		ans = 10 ** 6
		xyz = [0] * 3
		for x in range(1, 2 * a):
			for y in range(x, 2 * b, x):
				for d in range(2):
					co = c // y
					z = y * (co + d)
					cur = abs(a - x) + abs(b - y) + abs(c - z)
					if y <= z and cur < ans:
						ans = cur
						xyz = [x, y, z]
		print(ans)
		print(*xyz)
main()


import math
t = int(input())
for tt in range(t):
	(a, b, c) = map(int, input().split())
	aa = -1
	bb = -1
	cc = -1
	mm = 100000000000000000000
	for ai in range(1, 2 * a + 1):
		for bi in range(ai, 2 * b + 1, ai):
			for i in range(2):
				C = bi * (c // bi) + i * bi
				temp = abs(ai - a) + abs(bi - b) + abs(C - c)
				if temp < mm:
					mm = temp
					aa = ai
					bb = bi
					cc = C
	print(mm)
	print(aa, bb, cc)


import math
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	minn = math.inf
	for i in range(1, 2 * a + 1):
		for j in range(i, 2 * b + 1, i):
			for k in range(2):
				cC = j * (c // j) + k * j
				ans = abs(i - a) + abs(j - b) + abs(cC - c)
				if ans < minn:
					minn = ans
					A = i
					B = j
					C = cC
	print(minn)
	print(A, B, C)


for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	(at, bt, ct) = (1, 1, 1)
	ans = 10 ** 12
	for i in range(1, 10 ** 4 + 100):
		for j in range(i, 10 ** 4 + 100, i):
			for k in range(j, 10 ** 4 + 100, j):
				s = abs(a - i) + abs(b - j) + abs(c - k)
				if ans > s:
					ans = min(ans, s)
					(A, B, C) = (i, j, k)
	print(ans)
	print(A, B, C)


import random, math
from copy import deepcopy as dc
from bisect import bisect_left, bisect_right

def solution(a, b, c):
	fin = float('inf')
	(A, B, C) = (0, 0, 0)
	for i in range(1, 11000):
		for j in range(i, 11000, i):
			for k in range(j, 11000, j):
				t = abs(a - i) + abs(b - j) + abs(c - k)
				if t < fin:
					fin = t + 1 - 1
					(A, B, C) = (i, j, k)
	return [fin, A, B, C]

def input_test():
	for _ in range(int(input())):
		(a, b, c) = map(int, input().strip().split(' '))
		out = solution(a, b, c)
		print(out[0])
		print(*out[1:])

def test():
	pass
input_test()


import sys
input = sys.stdin.readline

def main():
	pos = []
	for a in range(1, 10100, 1):
		for b in range(a, 10100, a):
			for c in range(b, 10100, b):
				pos.append([a, b, c])
	for _ in range(int(input())):
		(a, b, c) = map(int, input().split())
		move = 100000000
		ans = []
		for el in pos:
			tmove = abs(a - el[0]) + abs(b - el[1]) + abs(c - el[2])
			if tmove < move:
				move = tmove
				ans = el
		print(move)
		print(*ans)
main()


for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	res = (2000000000.0, 0, 0, 0)
	for A in range(1, 2 * a):
		for B in range(A, 2 * b, A):
			t = c % B
			C = c - t if t < B - t else c + B - t
			t = abs(A - a) + abs(B - b) + abs(C - c)
			res = min((t, A, B, C), res)
	print(res[0])
	print(' '.join(map(str, res[1:])))


for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	ans = 10 ** 9
	A = B = C = 0
	for cA in range(1, 2 * a + 1):
		for cB in range(cA, 2 * b + 1, cA):
			for i in range(2):
				cC = cB * (c // cB) + i * cB
				res = abs(cA - a) + abs(cB - b) + abs(cC - c)
				if ans > res:
					(ans, A, B, C) = (res, cA, cB, cC)
	print(ans)
	print(A, B, C)


t = int(input())
for _ in range(t):
	(a, b, c) = tuple((int(i) for i in input().split(' ')))
	(aCopy, bCopy, cCopy) = (a, b, c)
	m = 30000
	for x in range(1, 11000):
		for y in range(x, 11000, x):
			for z in range(y, 11000, y):
				if m > abs(a - x) + abs(b - y) + abs(c - z):
					m = abs(a - x) + abs(b - y) + abs(c - z)
					aCopy = x
					bCopy = y
					cCopy = z
	print(m)
	print(aCopy, bCopy, cCopy)


triplets = []
for i in range(1, 11000):
	for j in range(i, 11000, i):
		for k in range(j, 11000, j):
			triplets.append((i, j, k))
for _ in range(int(input())):
	(a, b, c) = map(int, input().split(' '))
	mini = 1000000000000.0
	Ans = None
	for (i, j, k) in triplets:
		z = abs(a - i) + abs(b - j) + abs(c - k)
		if z < mini:
			mini = z
			Ans = (i, j, k)
		if z == 0:
			break
	print(mini)
	print(*Ans)


var = []
for aa in range(1, 10 ** 4 + 500):
	for bb in range(aa, 10 ** 4 + 500, aa):
		for cc in range(bb, 10 ** 4 + 500, bb):
			var += [(aa, bb, cc)]
t = int(input())
for _ in range(0, t):
	(a, b, c) = map(int, input().split())
	(aaa, bbb, ccc) = (-1, -1, -1)
	mod = 10 ** 9 + 7
	for i in var:
		divi = abs(a - i[0]) + abs(b - i[1]) + abs(c - i[2])
		if divi < mod:
			(aaa, bbb, ccc) = (i[0], i[1], i[2])
			mod = divi
	print(mod)
	print(aaa, bbb, ccc)


t = int(input())
for _ in range(t):
	(a, b, c) = map(int, input().split())
	C = int()
	(x1, x2, x3) = (0, 0, 0)
	ans = 10 ** 9
	for A in range(1, 2 * a):
		for B in range(A, 2 * b + 1, A):
			q = c % B
			mn = min(q, B - q)
			if q == mn:
				C = c - mn
			else:
				C = c + mn
			res = abs(a - A) + abs(b - B) + abs(c - C)
			if res < ans:
				ans = res
				x1 = A
				x2 = B
				x3 = C
	print(ans)
	print(x1, x2, x3)


import os
import sys
from io import BytesIO, IOBase
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
from math import floor

def main():
	try:
		for _ in range(inp()):
			(a, b, c) = invr()
			ans = 10 ** 9
			for ca in range(1, 2 * a + 1):
				for cb in range(ca, 2 * b + 1, ca):
					for i in range(2):
						cc = cb * (c // cb) + i * cb
						res = abs(ca - a) + abs(cb - b) + abs(cc - c)
						if ans > res:
							ans = res
							A = ca
							B = cb
							C = cc
			print(ans)
			print(A, B, C)
	except Exception as e:
		print(e)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def lcm(a, b):
	return a * b / gcd(a, b)
for _ in range(int(input())):
	ct = float('inf')
	(a, b, c) = map(int, input().split())
	ca = cb = cc = 0
	for pa in range(1, 10 ** 4 + 101):
		i = 1
		while pa * i <= 10 ** 4 + 100:
			pb = pa * i
			j = 1
			while pb * j <= 10 ** 4 + 100:
				pc = j * pb
				val = abs(pa - a) + abs(pb - b) + abs(pc - c)
				if val < ct:
					ct = val
					ca = pa
					cb = pb
					cc = pc
				j += 1
			i += 1
	print(ct)
	print(ca, cb, cc)


for t in range(int(input())):
	(a, b, c) = map(int, input().split())
	ans = 10 ** 9
	ar = []
	for A in range(1, 2 * a):
		for B in range(A, 2 * b, A):
			C1 = c - c % B
			C2 = c + B - c % B
			if C1 > 0 and C1 >= B:
				if ans > abs(a - A) + abs(b - B) + abs(c - C1):
					ans = abs(a - A) + abs(b - B) + abs(c - C1)
					ar = [A, B, C1]
			if C2 > 0 and C2 >= B:
				if ans > abs(a - A) + abs(b - B) + abs(c - C2):
					ans = abs(a - A) + abs(b - B) + abs(c - C2)
					ar = [A, B, C2]
	print(ans)
	print(ar[0], ar[1], ar[2])


I = lambda : list(map(int, input().split()))
for _ in range(int(input())):
	(a, b, c) = I()
	(A, B, C) = (0, 0, 0)
	res = 1000000000.0
	for i in range(1, 2 * a + 1):
		for j in range(i, 2 * b + 1, i):
			x = c // j * j
			x1 = c // j * j + j
			temp = -1
			other = -1
			if abs(c - x) < abs(c - x1):
				temp = abs(c - x)
				other = x
			else:
				temp = abs(c - x1)
				other = x1
			cur = abs(a - i) + abs(b - j) + temp
			if res > cur:
				res = cur
				A = i
				B = j
				C = other
	print(res)
	print(A, B, C)


for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	best = float('inf')
	best_pair = None
	for A in range(1, 2 * a + 1):
		B = A
		while B <= 2 * b:
			(c1, c2) = (B * (c // B), B * (c // B) + B)
			C = None
			if abs(c1 - c) > abs(c2 - c):
				C = c2
			else:
				C = c1
			if abs(a - A) + abs(b - B) + abs(c - C) < best:
				best_pair = (A, B, C)
				best = abs(a - A) + abs(b - B) + abs(c - C)
			B += A
	print(best)
	print(*best_pair)


import sys
input = sys.stdin.buffer.readline
t = int(input())
for i in range(t):
	(a, b, c) = [int(i) for i in input().split()]
	min_s = 10000 + 10000 + 10000 + 7
	mData = 0
	for x1 in range(1, 20000 + 1):
		x2 = x1
		while x2 <= 20000:
			x3 = c // x2 * x2
			x3_ = x3 + x2
			if x3 < 1:
				x3 = 20000 + 20000 + 20000 + 7
			if abs(c - x3_) < abs(c - x3):
				x3 = x3_
			sum_temp = abs(a - x1) + abs(b - x2) + abs(c - x3)
			if sum_temp < min_s:
				min_s = sum_temp
				mData = [x1, x2, x3]
			x2 += x1
	print(min_s)
	print(*mData)


MAX = float('inf')
MIN = float('-inf')
MOD = 1000000007
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	(i, j, cc) = (-1, -1, -1)
	ans = MAX
	for i in range(1, 2 * a):
		for j in range(i, 2 * b, i):
			for k in range(2):
				cc = c - c % j + k * j
				cal = abs(i - a) + abs(j - b) + abs(cc - c)
				if ans > cal:
					ans = cal
					A = i
					B = j
					C = cc
	print(ans)
	print(A, B, C)


import sys
from functools import lru_cache
from heapq import merge, heapify, heappop, heappush
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf
from collections import defaultdict as dd, deque, Counter as c
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
mod = pow(10, 9) + 7
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(var):
	sys.stdout.write(str(var))

def outln(var):
	sys.stdout.write(str(var) + '\n')

def l():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
for _ in range(int(data())):
	(a, b, c) = sp()
	answer = mod
	for i in range(1, pow(10, 4) + 1000):
		for j in range(i, pow(10, 4) + 1000, i):
			for k in range(j, pow(10, 4) + 1000, j):
				temp = abs(a - i) + abs(b - j) + abs(c - k)
				if temp < answer:
					(newa, newb, newc) = (i, j, k)
					answer = temp
	print(answer)
	print(newa, newb, newc)


import math

def rints():
	return list(map(int, input().split()))
t = int(input())
for _ in range(t):
	(a, b, c) = rints()
	best = (1, 1, 1)
	for A in range(1, 10001):
		B = A
		while B <= 12500:
			C = B
			for C in (math.floor(c / B) * B, math.ceil(c / B) * B):
				b_val = abs(a - best[0]) + abs(b - best[1]) + abs(c - best[2])
				c_val = abs(a - A) + abs(b - B) + abs(c - C)
				if b_val > c_val:
					best = (A, B, C)
			B += A
	print(abs(a - best[0]) + abs(b - best[1]) + abs(c - best[2]))
	print(*best)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	ans = float('inf')
	li = [0, 0, 0]
	for i in range(1, 2 * a + 1):
		x1 = abs(a - i)
		for j in range(i, 2 * b + 1, i):
			x2 = abs(b - j)
			rem = c % j
			qu = c // j
			if rem == 0:
				if x1 + x2 < ans:
					li = [i, j, c]
					ans = x1 + x2
			elif qu == 0:
				if x1 + x2 + j - rem < ans:
					ans = x1 + x2 + j - rem
					li = [i, j, c + j - rem]
			elif x1 + x2 + rem < ans:
				ans = x1 + x2 + rem
				li = [i, j, c - rem]
			elif x1 + x2 + j - rem < ans:
				ans = x1 + x2 + j - rem
				li = [i, j, c + j - rem]
	print(ans)
	print(*li)


for t in range(int(input())):
	(a, b, c) = [*map(int, input().split())]
	res = 1000000000.0
	pr = res
	rabc = []
	for A in range(1, 2 * a):
		for B in range(A, 2 * b, A):
			res = min(res, abs(A - a) + abs(B - b) + min(abs((c // B + 1) * B - c), abs(c // B * B - c)))
			if res != pr:
				pr = res
				rabc = [A, B, (c // B + (1 if abs((c // B + 1) * B - c) < abs(c // B * B - c) else 0)) * B]
	print(res)
	print(*rabc)


import sys
input = sys.stdin.readline
t = int(input())
for i in range(t):
	(a, b, c) = map(int, input().split())
	l = 100000000
	for i in range(1, 10100):
		for j in range(i, 10100, i):
			for k in range(j, 10100, j):
				p = abs(a - i) + abs(b - j) + abs(c - k)
				if p < l:
					l = p
					best = [i, j, k]
	print(l)
	print(*best)


for _ in range(int(input())):
	(a, b, c) = [int(x) for x in input().split()]
	ans = 1000000000.0
	(A, B, C) = [-1] * 3
	cA = 1
	while cA <= 2 * a:
		cB = cA
		while cB <= 2 * b:
			for i in range(2):
				cC = cB * (c // cB) + i * cB
				res = abs(cA - a) + abs(cB - b) + abs(cC - c)
				if ans > res:
					ans = res
					(A, B, C) = [cA, cB, cC]
			cB += cA
		cA += 1
	print(ans)
	print(A, B, C)


def i():
	return input()

def ii():
	return int(input())

def iis():
	return map(int, input().split())

def liis():
	return list(map(int, input().split()))

def sum_count(a, b):
	global count
	count += abs(a - b)
t = int(input())
for _ in range(t):
	(a, b, c) = iis()
	best_ans = [a, b, c]
	diff = float('INF')
	for new_a in range(1, 2 * a):
		for new_b in range(new_a, 2 * b, new_a):
			count = 0
			sum_count(a, new_a)
			new_c = max(new_b, c)
			div = new_c % new_b
			if div < new_b - div:
				new_c -= div
			else:
				new_c += new_b - div
			sum_count(b, new_b)
			sum_count(c, new_c)
			if count < diff:
				diff = count
				best_ans = [new_a, new_b, new_c]
	print(diff)
	print(' '.join(map(str, best_ans)))


t = int(input())
for _ in range(t):
	(a, b, c) = map(int, input().split())
	cnt = 10 ** 9
	(A, B, C) = (a, b, c)
	for i in range(1, 2 * a + 1):
		for j in range(i, 2 * b + 1, i):
			cc = c // j * j
			if c - cc > cc + j - c:
				cc = cc + j
			if abs(c - cc) + abs(b - j) + abs(a - i) < cnt and cc >= j:
				(A, B, C) = (i, j, cc)
				cnt = abs(c - C) + abs(b - B) + abs(a - A)
	print(cnt)
	print(A, B, C)


import random

def get_diff(key, a, b, c):
	diff = abs(a - key)
	tempb = b // key
	if abs(b - tempb * key) > abs(b - (tempb + 1) * key) or tempb == 0:
		tempb += 1
	tempb = tempb * key
	tempc = c // tempb
	if abs(c - tempc * tempb) > abs(c - (tempc + 1) * tempb):
		tempc += 1
	tempc = tempc * tempb
	return (diff + abs(tempb - b) + abs(tempc - c), [key, tempb, tempc])

def process():
	(a, b, c) = list(map(int, input().split()))
	min_diff = 10 ** 6
	min_list = []
	for i in range(1, 2 * a + 2):
		if abs(a - i) > min_diff:
			if i > a:
				break
			continue
		j = i
		while j <= 2 * b + 1:
			if abs(a - i) + abs(b - j) > min_diff:
				if j > b:
					j = 2 * b + 1
				j += i
				continue
			tl = [c // j * j, (1 + c // j) * j]
			for l in tl:
				if abs(i - a) + abs(j - b) + abs(l - c) < min_diff:
					min_diff = abs(i - a) + abs(j - b) + abs(l - c)
					min_list = [i, j, l]
			j += i
	min_list = [str(i) for i in min_list]
	print(min_diff)
	print(' '.join(min_list))
tests = int(input())
for i in range(0, tests):
	process()


from math import factorial
from collections import Counter
from heapq import heapify, heappop, heappush
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

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

def N():
	return int(input())

def comb(n, m):
	return factorial(n) / (factorial(m) * factorial(n - m)) if n >= m else 0

def perm(n, m):
	return factorial(n) // factorial(n - m) if n >= m else 0

def mdis(x1, y1, x2, y2):
	return abs(x1 - x2) + abs(y1 - y2)
mod = 1000000007
INF = float('inf')
import bisect

def main():
	for _ in range(N()):
		(a, b, c) = RL()
		res = INF
		ret = (-1, -1, -1)
		for i in range(1, 2 * a + 1):
			for j in range(i, 2 * b + 1, i):
				(aa, bb) = (i, j)
				dif = abs(aa - a) + abs(bb - b)
				for nx in [bb, c // bb * bb, c // bb * bb + bb]:
					op = abs(nx - c)
					td = dif + op
					if td < res:
						res = td
						ret = (aa, bb, nx)
		print(res)
		print(*ret)
main()


import os
import sys
import math
from io import BytesIO, IOBase
from fractions import Fraction
import collections
from itertools import permutations
from collections import defaultdict
from collections import deque
import threading
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

class SegmentTree:

	def __init__(self, data, default=0, func=lambda a, b: a + b):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class SegmentTree1:

	def __init__(self, data, default=10 ** 6, func=lambda a, b: min(a, b)):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)
MOD = 10 ** 9 + 7

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD
mod = 10 ** 9 + 7
omod = 998244353
prime = [True for i in range(10)]
pp = [0] * 10

def SieveOfEratosthenes(n=10):
	p = 2
	c = 0
	while p * p <= n:
		if prime[p] == True:
			c += 1
			for i in range(p, n + 1, p):
				pp[i] += 1
				prime[i] = False
		p += 1

def binarySearch(arr, n, key):
	left = 0
	right = n - 1
	mid = 0
	res = arr[n - 1]
	while left <= right:
		mid = (right + left) // 2
		if arr[mid] >= key:
			res = arr[mid]
			right = mid - 1
		else:
			left = mid + 1
	return res

def binarySearch1(arr, n, key):
	left = 0
	right = n - 1
	mid = 0
	res = arr[0]
	while left <= right:
		mid = (right + left) // 2
		if arr[mid] > key:
			right = mid - 1
		else:
			res = arr[mid]
			left = mid + 1
	return res
for i in range(int(input())):
	(a, b, c) = map(int, input().split())
	m = a + b + c - 3
	res = [1, 1, 1]
	for A in range(1, 2 * a + 1):
		for B in range(A, 2 * b + 1, A):
			d = max(1, c // B)
			c1 = d * B
			c2 = c1 + B
			r = abs(a - A) + abs(b - B) + abs(c - c1)
			if r < m:
				m = r
				res = [A, B, c1]
			r = abs(a - A) + abs(b - B) + abs(c - c2)
			if r < m:
				m = r
				res = [A, B, c2]
	print(m)
	print(*res)


import os
import sys
from io import BytesIO, IOBase
import heapq as h
from bisect import bisect_left, bisect_right
import time
from types import GeneratorType
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		import os
		self.os = os
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			self.os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from collections import defaultdict as dd, deque as dq, Counter as dc
import math, string
start_time = time.time()

def getInts():
	return [int(s) for s in input().split()]

def getInt():
	return int(input())

def getStrs():
	return [s for s in input().split()]

def getStr():
	return input()

def listStr():
	return list(input())

def getMat(n):
	return [getInts() for _ in range(n)]

def isInt(s):
	return '0' <= s[0] <= '9'
MOD = 998244353

def solve():
	(A, B, C) = getInts()
	best = 10 ** 18
	best_out = [-1, -1, -1]
	for a in range(1, 2 * 10 ** 4 + 1):
		for b in range(a, 2 * 10 ** 4 + 1, a):
			for i in range(2):
				c = b * (C // b) + i * b
				if c < b:
					continue
				x = min(best, abs(a - A) + abs(b - B) + abs(c - C))
				if x < best:
					best = x
					best_out = [a, b, c]
	print(best)
	print(*best_out)
	return
for _ in range(getInt()):
	solve()


t = int(input())
for i in range(t):
	line = input()
	[a, b, c] = [int(x) for x in line.split(' ')]
	mincost = 10000000000
	bestsol = [a, b, c]
	for ai in range(1, c * 2):
		ini = ai
		bi = ini
		while bi <= 20001:
			if bi % ai == 0 and abs(bi - b) + abs(ai - a) <= mincost:
				divis = c // bi
				for ci in [divis * bi, divis * bi + bi]:
					if ci % bi == 0 and ci >= bi and (c <= 20001):
						cost = abs(ci - c) + abs(bi - b) + abs(ai - a)
						if cost < mincost:
							bestsol = [ai, bi, ci]
							mincost = cost
			bi += ini
	print(mincost)
	print(' '.join([str(x) for x in bestsol]))


for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	ans = 10 ** 12
	for i in range(1, 11000):
		for j in range(i, 11000, i):
			for k in range(j, 11000, j):
				s = abs(a - i) + abs(b - j) + abs(c - k)
				if ans > s:
					ans = s
					(tA, tB, tC) = (i, j, k)
	print(ans)
	print(tA, tB, tC)


from sys import stdin
T = int(input())
for _ in range(T):
	(a, b, c) = map(int, stdin.readline().split())
	ans = 10 ** 8
	for A in range(1, 2 * a + 1):
		for B in range(A, 2 * b + 1, A):
			q_cb = c // B
			c_1 = q_cb * B
			c_2 = q_cb * B + B
			if c - c_1 >= c_2 - c:
				C = c_2
			else:
				C = c_1
			if abs(A - a) + abs(B - b) + abs(C - c) < ans:
				ans = abs(A - a) + abs(B - b) + abs(C - c)
				s = [A, B, C]
	print(ans)
	print(*s)


import sys
input = sys.stdin.readline

def main():
	t = int(input())
	for _ in range(t):
		(a, b, c) = map(int, input().split())
		a1 = 0
		b1 = 0
		c1 = 0
		mv = 300000
		for i in range(1, 2 * a):
			for j in range(i, 2 * b, i):
				k = c // j * j
				if mv > abs(c - k) + abs(b - j) + abs(i - a):
					mv = abs(c - k) + abs(b - j) + abs(i - a)
					a1 = i
					b1 = j
					c1 = k
				k = c // j * j + j
				if mv > abs(c - k) + abs(b - j) + abs(i - a):
					mv = abs(c - k) + abs(b - j) + abs(i - a)
					a1 = i
					b1 = j
					c1 = k
		print(int(mv))
		print(a1, b1, c1)
main()


def distance(a, b, c, d, e, f):
	return abs(a - d) + abs(b - e) + abs(c - f)
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	ans = (1, 1, 1)
	ans_dist = 999999999999999
	for first in range(1, pow(10, 4) + 1000):
		for second in range(first, pow(10, 4) + 1000, first):
			for third in range(second, pow(10, 4) + 1000, second):
				possibility = (first, second, third)
				if distance(first, second, third, a, b, c) < ans_dist:
					ans = (first, second, third)
					ans_dist = distance(*ans, a, b, c)
	print(ans_dist)
	print(*ans)


t = int(input())
while t:
	t -= 1
	(a, b, c) = map(int, input().split())
	ans = 10 ** 9
	for i in range(1, 2 * a + 1):
		for j in range(i, 2 * b, i):
			cur = abs(i - a) + abs(b - j)
			if c % j < j - c % j:
				if cur + c % j < ans:
					ans = cur + c % j
					l = [i, j, c - c % j]
			elif cur + j - c % j < ans:
				ans = cur + j - c % j
				l = [i, j, c + j - c % j]
	print(ans)
	print(*l)


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	(a, b, c) = map(int, input().split())
	mincost = 10 ** 20
	ans = ()
	for i in range(1, 10001):
		for j in range(i, 20001, i):
			cur = abs(i - a) + abs(j - b)
			k1 = c // j * j
			k2 = k1 + j
			if k1 >= j:
				cur1 = cur + abs(k1 - c)
			if k2 >= j:
				cur2 = cur + abs(k2 - c)
			if cur1 < mincost:
				mincost = cur1
				ans = (i, j, k1)
			if cur2 < mincost:
				mincost = cur2
				ans = (i, j, k2)
	print(mincost)
	print(*ans)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	mx = 1000000000
	sm = 0
	t1 = 0
	t2 = 0
	t3 = 0
	for i in range(1, 2 * a + 1):
		sm = abs(a - i)
		k = 1
		while i * k <= 2 * b:
			if k > 0:
				temp_b = i * k
				dif1 = abs(temp_b - b)
				c1 = c // temp_b
				if c1 > 0:
					temp_c = temp_b * c1
					dif2 = abs(temp_c - c)
					if mx > min(mx, sm + dif1 + dif2):
						mx = min(mx, sm + dif1 + dif2)
						t1 = i
						t2 = temp_b
						t3 = temp_c
				temp_c = temp_b * (c1 + 1)
				dif2 = abs(temp_c - c)
				if mx > min(mx, sm + dif1 + dif2):
					mx = min(mx, sm + dif1 + dif2)
					t1 = i
					t2 = temp_b
					t3 = temp_c
			k += 1
	print(mx)
	print(t1, t2, t3)


import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub
sys.setrecursionlimit(100000)
input = sys.stdin.readline
INF = 2 ** 62 - 1

def read_int():
	return int(input())

def read_int_n():
	return list(map(int, input().split()))

def read_float():
	return float(input())

def read_float_n():
	return list(map(float, input().split()))

def read_str():
	return input().strip()

def read_str_n():
	return list(map(str, input().split()))

def error_print(*args):
	print(*args, file=sys.stderr)

def mt(f):
	import time

	def wrap(*args, **kwargs):
		s = time.time()
		ret = f(*args, **kwargs)
		e = time.time()
		error_print(e - s, 'sec')
		return ret
	return wrap

@mt
def slv(ABC):
	(A, B, C) = ABC
	M = 10 ** 4
	ans = (INF, None)
	for a in range(1, M + 1):
		ac = abs(A - a)
		for x in range(1, -(-M // a) + 1):
			bc = abs(B - x * a)
			for y in range(1, -(-M // (a * x)) + 1):
				cc = abs(C - x * y * a)
				s = ac + bc + cc
				assert a <= x * a <= x * y * a
				if s < ans[0]:
					ans = (s, (a, x * a, x * y * a))
	print(ans[0])
	print(*ans[1])

def main():
	T = read_int()
	for _ in range(T):
		ABC = read_int_n()
		slv(ABC)
main()


mod = 9999999999
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	answer = mod
	for i in range(1, pow(10, 4) + 1000):
		for j in range(i, pow(10, 4) + 1000, i):
			for k in range(j, pow(10, 4) + 1000, j):
				temp = abs(a - i) + abs(b - j) + abs(c - k)
				if temp < answer:
					(newa, newb, newc) = (i, j, k)
					answer = temp
	print(answer)
	print(newa, newb, newc)


import os
import sys
from io import BytesIO, IOBase
from itertools import accumulate

def main():
	for _ in range(int(input())):
		(a, b, c) = map(int, input().split())
		ans = float('inf')
		for i in range(1, 20000):
			for j in range(i, 20000, i):
				for k in range(j, 20000, j):
					if abs(a - i) + abs(b - j) + abs(c - k) < ans:
						ans = abs(a - i) + abs(b - j) + abs(c - k)
						aa = i
						bb = j
						cc = k
		print(ans)
		print(aa, bb, cc)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


t = int(input())
while t:
	(a, b, c) = map(int, input().split())
	ans = [10 ** 18, a, b, c]
	for i in range(1, 2 * 10 ** 4 + 1):
		for j in range(0, 2 * 10 ** 4 + 1, i):
			if j == 0:
				continue
			if c % j < j - c % j:
				temp = [abs(i - a) + abs(j - b) + c % j, i, j, c - c % j]
			else:
				temp = [abs(i - a) + abs(j - b) + j - c % j, i, j, c + j - c % j]
			if temp[0] < ans[0]:
				ans = temp
	print(ans[0])
	print(ans[1], ans[2], ans[3])
	t -= 1


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	(a, b, c) = map(int, input().split())
	(A, B, C) = (-1, -1, -1)
	val = 10 ** 18
	for ca in range(1, 2 * a + 1):
		for cb in range(ca, 2 * b, ca):
			for i in range(2):
				cc = cb * (c // cb) + i * cb
				score = abs(ca - a) + abs(cb - b) + abs(cc - c)
				if val > score:
					val = score
					A = ca
					B = cb
					C = cc
	print(val)
	print(A, B, C)


from sys import stdin, stdout
import math, bisect, heapq
from collections import Counter, deque, defaultdict
L = lambda : list(map(int, stdin.readline().strip().split()))
I = lambda : int(stdin.readline().strip())
S = lambda : stdin.readline().strip()
C = lambda : stdin.readline().strip().split()

def pr(a):
	print(' '.join(list(map(str, a))))

def solve():
	(a, b, c) = L()
	ans = 10 ** 15
	(x, y, z) = (a, b, c)
	for i in range(1, 2 * a):
		for j in range(i, 2 * b, i):
			for k in range(j, 2 * c, j):
				if abs(a - i) + abs(b - j) + abs(c - k) < ans:
					ans = abs(a - i) + abs(b - j) + abs(c - k)
					(x, y, z) = (i, j, k)
	print(ans)
	print(x, y, z)
for _ in range(I()):
	solve()


t = int(input())
for _ in range(t):
	(a, b, c) = map(int, input().split())
	m = 100000000
	(p, q, r) = (0, 0, 0)
	for i in range(1, 2 * a + 1):
		for j in range(i, 2 * b + 1, i):
			for k in range(2):
				x = j * (c // j) + k * j
				s = abs(i - a) + abs(j - b) + abs(x - c)
				if m > s:
					m = s
					p = i
					q = j
					r = x
	print(m)
	print(p, q, r)


t = int(input())
for _ in range(t):
	(a, b, c) = map(int, input().split())
	ans = 10 ** 18
	cand = []
	for ta in range(1, 2 * 10 ** 4 + 1):
		for n in range(1, 2 * 10 ** 4 // ta + 1):
			tmp = abs(ta - a)
			tb = n * ta
			tmp += abs(tb - b)
			tc1 = c + (tb - c % tb)
			tc2 = c - c % tb
			if tc2 >= tb:
				if abs(tc1 - c) <= abs(tc2 - c):
					tc = tc1
				else:
					tc = tc2
			else:
				tc = tc1
			tmp += abs(tc - c)
			if tmp < ans:
				ans = tmp
				cand = [ta, tb, tc]
	print(ans)
	print(*cand)


import sys
input = sys.stdin.readline

def solve():
	(a, b, c) = map(int, input().split())
	mn = 1 << 32
	ans = None
	for a0 in range(1, 20001):
		for b0 in range(a0, 20001, a0):
			m = c % b0
			if m != c:
				if m <= b0 - m:
					c0 = c - m
				else:
					c0 = c + b0 - m
				cost = abs(a0 - a) + abs(b0 - b) + abs(c0 - c)
			else:
				c0 = c + b0 - m
				cost = abs(a0 - a) + abs(b0 - b) + abs(c0 - c)
			if cost < mn:
				mn = cost
				ans = (a0, b0, c0)
	print(mn)
	print(*ans)
for nt in range(int(input())):
	solve()


import sys
t = int(sys.stdin.readline())
for _ in range(t):
	(a, b, c) = map(int, sys.stdin.readline().split())
	ans = float('inf')
	for i in range(1, c + 1):
		for j in range(i, c + 1, i):
			if b % i == 0:
				(x, y) = (c // j, c // j + 1)
				(m, n) = (j * x, j * y)
				if m != 0 and abs(c - m) < abs(n - c):
					if abs(a - i) + abs(c - m) + abs(b - j) < ans:
						ans = abs(a - i) + abs(c - m) + abs(b - j)
						new = [i, j, m]
				elif abs(a - i) + abs(c - n) + abs(b - j) < ans:
					ans = abs(a - i) + abs(c - n) + abs(b - j)
					new = [i, j, n]
			else:
				(x, y) = (j // i, j // i + 1)
				(m, n) = (i * x, i * y)
				if m != 0:
					(p, q) = (c // m, c // m + 1)
					(g, h) = (p * m, q * m)
					if g != 0 and abs(g - c) < abs(c - h):
						if abs(g - c) + abs(m - b) + abs(i - a) < ans:
							ans = abs(g - c) + abs(m - b) + abs(i - a)
							new = [i, m, g]
					elif abs(h - c) + abs(m - b) + abs(i - a) < ans:
						ans = abs(h - c) + abs(m - b) + abs(i - a)
						new = [i, m, h]
				(p, q) = (c // n, c // n + 1)
				(g, h) = (p * n, q * n)
				if g != 0 and abs(g - c) < abs(c - h):
					if abs(g - c) + abs(n - b) + abs(i - a) < ans:
						ans = abs(g - c) + abs(n - b) + abs(i - a)
						new = [i, n, g]
				elif abs(h - c) + abs(n - b) + abs(i - a) < ans:
					ans = abs(h - c) + abs(n - b) + abs(i - a)
					new = [i, n, h]
	print(ans)
	print(*new)


def ops(a, b, c, A, B, C):
	return round(abs(a - A) + abs(b - B) + abs(c - C))

def wanna_be_c(c, B):
	return max(round(c / B) * B, B)
div_pair = []
for i in range(1, 10001):
	j = i
	while j <= 10000:
		div_pair.append([i, j])
		j += i
	div_pair.append([i, j])
t = int(input())
for tt in range(t):
	(a, b, c) = [int(x) for x in input().split(' ')]
	sums = []
	for i in range(len(div_pair)):
		sums.append(ops(a, b, c, div_pair[i][0], div_pair[i][1], wanna_be_c(c, div_pair[i][1])))
	p = sums.index(min(sums))
	print(sums[p])
	print(div_pair[p][0], div_pair[p][1], wanna_be_c(c, div_pair[p][1]), sep=' ')


import string
from collections import defaultdict, Counter
from math import sqrt, log10, log2, log, gcd, ceil, floor, factorial
from bisect import bisect_left, bisect_right
from itertools import permutations, combinations_with_replacement
import sys, io, os
input = sys.stdin.readline
sys.setrecursionlimit(10000)
mod = int(pow(10, 7) + 9)
inf = float('inf')

def get_list():
	return [int(i) for i in input().split()]

def yn(a):
	print('YES' if a else 'NO')
n = 20000
l = []
m = [[]]
mrev = [[] for i in range(n + 1)]
for i in range(1, n + 1):
	m.append([])
	for j in range(i, n + 1, i):
		m[-1].append(j)
		mrev[j].append(i)
		l.append([i, j])
t = 1
t = int(input())

def update(a, b, c, i, j, k):
	return abs(i - a) + abs(j - b) + abs(k - c)
for _ in range(t):
	(a, b, c) = get_list()
	if c % b == 0 and b % a == 0:
		print(0)
		print(a, b, c)
		continue
	mina = inf
	ans = [a, b, c]
	for iter in l:
		i = iter[0]
		j = iter[1]
		k = c // j * j
		if k < j:
			k = j
		version = update(a, b, c, i, j, k)
		if version < mina:
			mina = version
			answer = [i, j, k]
		k += j
		version = update(a, b, c, i, j, k)
		if version < mina:
			mina = version
			answer = [i, j, k]
	print(mina)
	print(*answer)


from math import ceil
import sys
input = sys.stdin.readline
for i in range(int(input())):
	(a, b, c) = map(int, input().split())
	MIN = float('inf')
	for i in range(1, 11000):
		for j in range(i, 11000, i):
			newc1 = c // j * j
			newc2 = ceil(c / j) * j
			y1 = abs(a - i) + abs(b - j) + abs(c - newc1)
			y2 = abs(a - i) + abs(b - j) + abs(c - newc2)
			if y1 < MIN:
				MIN = y1
				(a1, b1, c1) = (i, j, newc1)
			if y2 < MIN:
				MIN = y2
				(a1, b1, c1) = (i, j, newc2)
	print(MIN)
	print(a1, b1, c1)


def solve(a, b, c):
	mx = a + b - 2
	best = mx
	bestv = (1, 1, c)
	for aa in range(1, 2 * a):
		for bb in range(aa, 2 * b, aa):
			cc = bb
			for ccc in (c // bb * bb, (c + bb - 1) // bb * bb):
				if abs(cc - c) > abs(ccc - c):
					cc = ccc
			cur = abs(a - aa) + abs(b - bb) + abs(c - cc)
			if cur < best:
				best = cur
				bestv = (aa, bb, cc)
	return (best, bestv)
t = int(input())
for _ in range(t):
	(a, b, c) = map(int, input().split())
	(r, x) = solve(a, b, c)
	print(r)
	print(*x)


t = int(input())
ans = []
for _ in range(t):
	(a, b, c) = map(int, input().split())
	out = 10 ** 9
	out_l = [a, b, c]
	for A in range(1, 2 * a):
		B = A
		while B <= 2 * b:
			C = int(c / B) * B
			cost = abs(a - A) + abs(b - B) + abs(c - C)
			if cost < out:
				out = cost
				out_l = [A, B, C]
			cost = abs(a - A) + abs(b - B) + abs(c - (C + B))
			if cost < out:
				out = cost
				out_l = [A, B, C + B]
			B += A
	ans.append(str(out))
	ans.append(' '.join(list(map(str, out_l))))
print('\n'.join(ans))


MAX = 15000
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	ans = float('inf')
	(aa, bb, cc) = (0, 0, 0)
	for xa in range(1, MAX + 1):
		for xb in range(xa, MAX + 1, xa):
			for xc in range(xb, MAX + 1, xb):
				if abs(a - xa) + abs(b - xb) + abs(c - xc) < ans:
					ans = abs(a - xa) + abs(b - xb) + abs(c - xc)
					(aa, bb, cc) = (xa, xb, xc)
	print(ans)
	print(aa, bb, cc)


from sys import stdin

def find_closest(x, y):
	first = int(y / x) * x
	second = first + x
	if abs(first - y) > abs(second - y):
		return (abs(second - y), second)
	else:
		return (abs(first - y), first)
t = int(stdin.readline())
for i in range(t):
	(a, b, c) = list(map(int, stdin.readline().split(' ')))
	A = -1
	B = -1
	C = -1
	ans = 1000000000
	for cA in range(1, 2 * a + 1):
		for cB in range(cA, 2 * b + 1, cA):
			(res, cC) = find_closest(cB, c)
			if res + abs(cA - a) + abs(cB - b) < ans:
				ans = res + abs(cA - a) + abs(cB - b)
				A = cA
				B = cB
				C = cC
	print(str(ans))
	print(str(A) + ' ' + str(B) + ' ' + str(C))


import math
import sys
from collections import defaultdict, Counter
from itertools import groupby
rt = lambda : map(int, input().split())
ri = lambda : int(input())
rl = lambda : list(map(int, input().split()))

def main():
	t = ri()
	for _ in range(t):
		(a, b, c) = rt()
		res = math.inf
		(A, B, C) = (-1, -1, -1)
		for i in range(1, 2 * a + 1):
			ma = 1
			while i * ma <= 2 * b:
				c_cand1 = c // (i * ma) * (i * ma)
				c_cand2 = c // (i * ma) * (i * ma) + i * ma
				c_cand = c_cand1
				if c_cand1 < i * ma or (c_cand2 >= i * ma and abs(c - c_cand2) < abs(c - c_cand1)):
					c_cand = c_cand2
				if abs(i - a) + abs(i * ma - b) + abs(c_cand - c) < res:
					res = abs(i - a) + abs(i * ma - b) + abs(c_cand - c)
					(A, B, C) = (i, i * ma, c_cand)
				ma += 1
		print(res)
		print(A, B, C)
main()


for o in range(int(input())):
	(a, b, c) = map(int, input().split())
	A = B = C = -1
	result = 10 ** 9
	for a_i in range(1, 2 * a + 1):
		for b_i in range(a_i, 2 * b + 1, a_i):
			for k in range(0, 2):
				c_i = b_i * (c // b_i) + k * b_i
				count = abs(a_i - a) + abs(b_i - b) + abs(c_i - c)
				if result > count:
					result = count
					A = a_i
					B = b_i
					C = c_i
	print(result)
	print(A, B, C)


for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	n = 10 ** 4 + 101
	mn = float('inf')
	for na in range(1, n):
		x = 1
		while na * x <= n:
			nb = x * na
			y = 1
			while nb * y <= n:
				nc = y * nb
				v = abs(na - a) + abs(nb - b) + abs(nc - c)
				if v < mn:
					mn = v
					ans = [na, nb, nc]
				y += 1
			x += 1
	print(mn)
	print(*ans)


t = int(input())
while t:
	(a, b, c) = map(int, input().split())
	ans = [-1, -1, -1]
	mi = 100000000000
	for i in range(1, 2 * a + 1):
		ai = i
		bi = ai
		while bi <= 2 * b:
			ci = c // bi * bi
			if ci >= bi:
				m = abs(a - ai) + abs(b - bi) + abs(c - ci)
				if mi > m:
					mi = m
					ans = [ai, bi, ci]
			ci = c // bi * bi + bi
			if ci >= bi:
				m = abs(a - ai) + abs(b - bi) + abs(c - ci)
				if mi > m:
					mi = m
					ans = [ai, bi, ci]
			bi = bi + ai
	print(mi)
	print(*ans)
	t -= 1


def solve():
	(a, b, c) = [int(s) for s in input().strip().split()]
	minstep = float('inf')
	result = (a, b, c)
	for A in range(1, 2 * a):
		for B in range(A, 2 * b, A):
			for C in [c // B * B, c // B * B + B]:
				if C >= B:
					step = abs(a - A) + abs(b - B) + abs(c - C)
					if step < minstep:
						minstep = step
						result = (A, B, C)
	print(minstep)
	print(*result)

def main():
	for _ in range(int(input().strip())):
		solve()
main()


import sys
import os
import time
import collections
from collections import Counter, deque
import itertools
import math
import timeit
import random
from io import BytesIO, IOBase
from bisect import bisect_left

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=1):
	divisors = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				divisors.append(i)
			else:
				divisors.extend([i, n // i])
	return divisors

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def flin(d, x, default=-1):
	left = right = -1
	for i in range(len(d)):
		if d[i] == x:
			if left == -1:
				left = i
			right = i
	if left == -1:
		return (default, default)
	else:
		return (left, right)

def ceil(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def prr(a, sep=' '):
	print(sep.join(map(str, a)))

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
for _ in range(ii()):
	(a, b, c) = mi()
	mn = 10 ** 6
	for tmpa in range(1, 2 * a):
		for tmpb in range(tmpa, 2 * b, tmpa):
			for k in range(2):
				tmpc = c // tmpb * tmpb + k * tmpb
				res = abs(a - tmpa) + abs(b - tmpb) + abs(c - tmpc)
				if res < mn:
					mn = res
					A = tmpa
					B = tmpb
					C = tmpc
	print(mn)
	print(A, B, C)


import io
import os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
import math
t = int(input())
for tc in range(t):
	(a, b, c) = map(int, input().split())
	moves = 10 ** 10
	(anew, bnew, cnew) = (0, 0, 0)
	for i in range(1, 4 * a):
		for j in range(i, 4 * b, i):
			possiblec1 = c // j * j
			possiblec2 = (c // j + 1) * j
			movereq1 = abs(a - i) + abs(b - j) + abs(c - possiblec1)
			movereq2 = abs(a - i) + abs(b - j) + abs(c - possiblec2)
			if movereq1 < moves:
				moves = movereq1
				anew = i
				bnew = j
				cnew = possiblec1
			if movereq2 < moves:
				moves = movereq2
				anew = i
				bnew = j
				cnew = possiblec2
	print(moves)
	print(anew, bnew, cnew)


for _ in range(int(input())):
	(a, b, c) = list(map(int, input().split()))
	ans = 71227122
	abc = []
	for A in range(1, 10001, 1):
		for B in range(A, 20001, A):
			for C in [c // B * B, (c // B + 1) * B]:
				if C < B:
					C = B
				diff = abs(A - a) + abs(B - b) + abs(C - c)
				if diff < ans:
					ans = diff
					abc = [A, B, C]
	print(ans)
	print(*abc)


from collections import Counter
from collections import defaultdict
import math
t = int(input())
for _ in range(0, t):
	(a, b, c) = list(map(int, input().split()))
	i = 1
	ans = 9999999
	pairs = [0, 0, 0]
	while i < 12000:
		j = i
		while j < 12000:
			k = j
			while k < 12000:
				diff = abs(a - i) + abs(b - j) + abs(c - k)
				if diff < ans:
					ans = diff
					pairs = [i, j, k]
				k = k + j
			j = j + i
		i = i + 1
	print(ans)
	print(*pairs)


for test in range(int(input())):
	(a, b, c) = map(int, input().split())
	ans = 1000000000.0
	for ca in range(1, 2 * a + 1):
		for cb in range(ca, 2 * b + 1, ca):
			for i in range(0, 2):
				cc = cb * (c // cb) + i * cb
				res = abs(ca - a) + abs(cb - b) + abs(cc - c)
				if ans > res:
					ans = res
					A = ca
					B = cb
					C = cc
	print(ans)
	print(A, B, C)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(a, b, c) = list(map(int, input().split()))
	ans = 10 ** 18
	index = [0, 0, 0]
	for x in range(1, c + 1):
		for y in range(x, c + 100, x):
			cost = abs(a - x) + abs(b - y)
			if c % y < y - c % y:
				z = c - c % y
				cost += c % y
			else:
				z = c + (y - c % y)
				cost += y - c % y
			if ans > cost:
				ans = cost
				index = [x, y, z]
	print(ans)
	print(*index)


import sys
input = sys.stdin.readline
Q = int(input())
Query = [list(map(int, input().split())) for _ in range(Q)]
for (A, B, C) in Query:
	ans = 10 ** 15
	for a in range(1, C + 1):
		m = 1
		while True:
			b = m * a
			k = C // b
			c = k * b
			if abs(c - C) > abs((k + 1) * b - C):
				c = (k + 1) * b
			tmp = abs(a - A) + abs(b - B) + abs(c - C)
			if tmp < ans:
				ans = tmp
				E = [a, b, c]
			if b > C:
				break
			m += 1
	print(ans)
	print(*E)


for t in range(int(input())):
	(a, b, c) = map(int, input().split())
	(mini, count) = (999999, 0)
	(x, y, z, flag) = (0, 0, 0, 0)
	for i in range(1, 2 * a + 1):
		(count, flag) = (0, 0)
		j = i
		while j <= 2 * b:
			count = abs(a - i)
			count += abs(b - j)
			if c % j < j - c % j:
				count += c % j
				flag = 1
			else:
				count += j - c % j
				flag = 2
			if count < mini:
				mini = count
				if flag == 1:
					(x, y, z) = (i, j, j * (c // j))
				else:
					(x, y, z) = (i, j, j * (c // j + 1))
			j += i
	print(mini)
	print(x, y, z)


import sys
from collections import defaultdict
from itertools import permutations, combinations
import string
from heapq import heapify, heappush, heappop

def solve():
	alphabets = string.ascii_lowercase
	digits = string.digits
	get_arr = lambda type_=int: list(map(type_, sys.stdin.readline().rstrip('\n').split()))
	inp = lambda type_=int: type_(sys.stdin.readline().rstrip('\n'))
	pair = lambda type_=int: map(type_, sys.stdin.readline().rstrip('\n').split(' '))
	t = inp()
	pairs = []
	for a in range(1, int(10000.0) + 100):
		for b in range(a, int(10000.0) + a, a):
			for c in range(b, int(10000.0) + b, b):
				pairs.append((a, b, c))
	for _ in range(t):
		(a, b, c) = get_arr()
		m = float('inf')
		minpair = (0, 0, 0)
		for (a1, b1, c1) in pairs:
			res = abs(a1 - a) + abs(b1 - b) + abs(c1 - c)
			if res < m:
				m = res
				minpair = (a1, b1, c1)
		print(m)
		print(minpair[0], minpair[1], minpair[2])
solve()


for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	ans = 10 ** 12
	(A, B, C) = (a, b, c)
	for i in range(1, 2 * a + 1):
		for j in range(i, 2 * b + 1, i):
			if c <= j:
				k = j
			elif c > j:
				if c % j < j - c % j:
					k = c - c % j
				else:
					k = c + j - c % j
			s = abs(i - a) + abs(j - b) + abs(k - c)
			if ans > s:
				ans = s
				(A, B, C) = (i, j, k)
	print(ans)
	print(A, B, C)


def main():
	(a, b, c) = map(int, input().split())
	(A, B, C) = (-1, -1, -1)
	ans = 1000000000.0
	for i in range(1, 2 * a + 1):
		for j in range(i, 2 * b + 1, i):
			for k in range(2):
				cC = j * (c // j) + k * j
				res = abs(a - i) + abs(b - j) + abs(c - cC)
				if ans > res:
					ans = res
					A = i
					B = j
					C = cC
	print(ans)
	print(A, B, C)
	return

def test():
	t = int(input())
	while t:
		main()
		t -= 1
test()


def solve():
	(a, b, c) = map(int, input().split())
	A = B = C = -1
	ans = 1000000000.0
	cA = 1
	while cA <= 2 * a:
		cB = cA
		while cB <= 2 * b:
			for i in range(2):
				cC = cB * (c // cB) + i * cB
				res = abs(cA - a) + abs(cB - b) + abs(cC - c)
				if ans > res:
					ans = res
					A = cA
					B = cB
					C = cC
			cB += cA
		cA += 1
	print(ans)
	print(A, B, C)
for _ in range(int(input())):
	solve()


import os
import sys
from io import BytesIO, IOBase
import threading
from math import cos, sin, pi
mod = 998244353

def main():
	for _ in range(int(input())):
		(a, b, c) = map(int, input().split())
		ans = float('inf')
		p = -1
		for a_ in range(1, 2 * a + 1):
			cost = abs(a - a_)
			for d in range(1, 2 * b // a_ + 1):
				b_ = a_ * d
				cost += abs(b - b_)
				for d_ in range(-1, 2):
					c_ = b_ * (c // b_ + d_ if b_ > 0 else -100)
					cost += abs(c - c_)
					if cost < ans and a_ > 0 and (b_ > 0) and (c_ >= b_):
						ans = cost
						p = (a_, b_, c_)
					cost -= abs(c - c_)
				cost -= abs(b - b_)
		print(ans)
		print(*p)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import sys

def input():
	return sys.stdin.readline().rstrip('\r\n')
for cas in range(int(input())):
	(a, b, c) = map(int, input().split())
	ans = 1061109567
	for i in range(1, c + 1):
		for times in range(1, int(20000.0 + 5)):
			j = i * times
			if j > int(20000.0):
				break
			cur = abs(i - a) + abs(j - b) + min(c % j, j - c % j)
			if cur < ans:
				ans = cur
				(A, B) = (i, j)
				C = c - c % j if c % j <= j - c % j else c + j - c % j
			ans = min(ans, cur)
	print(ans)
	print(A, B, C)


t = int(input())
for i in range(t):
	(a, b, c) = map(int, input().split())
	ans = 100000
	(x, y, z) = (0, 0, 0)
	for i in range(1, 11000):
		for j in range(i, 11000, i):
			for k in [c // j * j, c // j * j + j]:
				if ans > abs(a - i) + abs(b - j) + abs(c - k):
					ans = abs(a - i) + abs(b - j) + abs(c - k)
					(x, y, z) = (i, j, k)
	print(ans)
	print(x, y, z)


testcase = int(input())
for i in range(testcase):
	(a, b, c) = map(int, input().split())
	ans = 10 ** 12
	for ca in range(1, 2 * a, 1):
		for cb in range(ca, 2 * b, ca):
			for k in range(2):
				cc = cb * (c // cb) + k * cb
				res = abs(ca - a) + abs(cb - b) + abs(c - cc)
				if ans > res:
					ans = res
					A = ca
					B = cb
					C = cc
	print(ans)
	print(A, B, C)


from sys import stdin
input = stdin.buffer.readline
last = []
for _ in range(int(input())):
	t = int(1000000000.0)
	(A, B, C) = map(int, input().split())
	for a in range(1, 10001):
		for b in range(a, 20001, a):
			c = C // b * b
			c = c if abs(c - C) < abs(c + b - C) else c + b
			x = abs(a - A) + abs(b - B) + abs(c - C)
			if x < t:
				t = x
				(u, v, w) = (a, b, c)
	last.append(str(t))
	last.append(' '.join([str(u), str(v), str(w)]))
print('\n'.join(last))


import sys
try:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
except:
	pass
input = sys.stdin.readline
for tt in range(int(input())):
	(a, b, c) = map(int, input().split())
	m = float('inf')
	for i in range(1, 10000 + 100):
		for j in range(i, 10000 + 100, i):
			for k in range(j, 10000 + 100, j):
				diff = abs(a - i) + abs(b - j) + abs(c - k)
				if diff < m:
					ca = i
					cb = j
					cc = k
					m = diff
	print(m)
	print(ca, cb, cc)


t = int(input())
for _ in range(t):
	(a, b, c) = map(int, input().split())
	cnt = 99999999999999999999999999999999999999999
	ans = [0, 0, 0]
	for i in range(1, 15000 + 1):
		s = abs(i - a)
		temp = s
		j = i * 1
		o = 1
		while j <= 15000:
			temp += abs(j - b)
			f = c // j
			(l, h) = (f * j, (f + 1) * j)
			kk = h
			if abs(l - c) < abs(h - c):
				kk = l
			temp += abs(kk - c)
			if temp < cnt:
				cnt = temp
				ans[0] = i
				ans[1] = j
				ans[2] = kk
			temp = s
			o += 1
			j = i * o
	print(cnt)
	print(' '.join(map(str, ans)))


def main():
	t = int(input())
	allans = []
	for _ in range(t):
		(a, b, c) = readIntArr()
		maxDiff = a - 1 + b - 1
		diff = inf
		ans = [None, None, None]
		aa = 1
		while True:
			aChange = abs(aa - a)
			if aChange > maxDiff:
				break
			bb = max(aa, aChange + b - maxDiff)
			k = (bb + aa - 1) // aa
			bb = k * aa
			while True:
				bChange = abs(bb - b)
				if aChange + bChange > maxDiff:
					break
				k = c // bb
				k = max(1, k)
				cc1 = k * bb
				cc2 = (k + 1) * bb
				cChange1 = abs(cc1 - c)
				cChange2 = abs(cc2 - c)
				if cChange1 < cChange2:
					cc = cc1
					cChange = cChange1
				else:
					cc = cc2
					cChange = cChange2
				if aChange + bChange + cChange < diff:
					diff = aChange + bChange + cChange
					ans = [aa, bb, cc]
				bb += aa
			aa += 1
		allans.append([diff])
		allans.append(ans)
	multiLineArrayOfArraysPrint(allans)
	return
import sys
input = sys.stdin.buffer.readline

def oneLineArrayPrint(arr):
	print(' '.join([str(x) for x in arr]))

def multiLineArrayPrint(arr):
	print('\n'.join([str(x) for x in arr]))

def multiLineArrayOfArraysPrint(arr):
	print('\n'.join([' '.join([str(x) for x in y]) for y in arr]))

def readIntArr():
	return [int(x) for x in input().split()]
inf = float('inf')
MOD = 10 ** 9 + 7
main()


import io
import os
from collections import Counter, defaultdict, deque

def solve(A, B, C):

	def cost(a, b, c):
		return abs(A - a) + abs(B - b) + abs(C - c)
	best = (cost(1, 1, 1), (1, 1, 1))
	for a in range(1, 2 * A + 1):
		for b in range(a, 2 * B + 1, a):
			for c in [b * (C // b), b * (C // b) + b]:
				best = min(best, (cost(a, b, c), (a, b, c)))
	(bestCost, bestSol) = best
	return str(bestCost) + '\n' + ' '.join(map(str, bestSol))
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
T = int(input())
for t in range(T):
	(A, B, C) = [int(x) for x in input().split()]
	ans = solve(A, B, C)
	print(ans)


for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	A = B = C = 1
	ans = a + b + c - 3
	nums = [1, 1, 1]
	for i in range(1, 2 * a + 1):
		for j in range(i, 2 * b + 1, i):
			for k in range(2):
				temp = (c // j + k) * j
				if temp >= j:
					diff = abs(a - i) + abs(b - j) + abs(c - temp)
					if diff < ans:
						ans = diff
						(A, B, C) = (i, j, temp)
	print(ans)
	print(A, B, C)


from math import sqrt
t = int(input())

def verify(a, b, c):
	if a == 0 or b == 0:
		return False
	return c % b == b % a == 0
for _ in range(t):
	(a, b, c) = map(int, input().split())
	bs = [0] * 20000
	for bi in range(1, 20001):
		ci = c // bi * bi
		cdist = min(c - ci, ci + bi - c)
		bdist = abs(b - bi)
		bs[bi - 1] = cdist + bdist
	bestPos = 30000
	bestPosAi = -1
	bestPosBi = -1
	for ai in range(1, 20001):
		for bi in range(ai, 20001, ai):
			adist = abs(a - ai)
			bValue = bs[bi - 1]
			if adist + bValue < bestPos:
				bestPos = adist + bValue
				bestPosAi = ai
				bestPosBi = bi
	print(bestPos)
	bestPosCiL = c // bestPosBi * bestPosBi
	if c - bestPosCiL > bestPosCiL + bestPosBi - c:
		bestPosCiL = bestPosCiL + bestPosBi
	print(bestPosAi, bestPosBi, bestPosCiL)


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
mod = int(pow(10, 9) + 7)
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def L():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
try:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('../output.txt', 'w')
except:
	pass
for _ in range(L()[0]):
	(a, b, c) = L()
	mn = 10 ** 10
	for i in range(1, 2 * a + 1):
		for j in range(i, 2 * b, i):
			c1 = c // j * j
			c2 = c1 + j
			cost = abs(a - i) + abs(b - j) + min(abs(c - c1), abs(c - c2))
			if cost < mn:
				mn = cost
				x = [i, j]
				if abs(c - c1) < abs(c - c2):
					x.append(c1)
				else:
					x.append(c2)
	print(mn)
	print(*x)


t = int(input())
for _ in range(t):
	(a, b, c) = map(int, input().split())
	ans = [0, 0, 0]
	m = 9999999999
	for i in range(1, 10500):
		for j in range(i, 10500, i):
			for k in range(j, 10500, j):
				if m > abs(a - i) + abs(b - j) + abs(c - k):
					m = abs(a - i) + abs(b - j) + abs(c - k)
					ans = [i, j, k]
	print(m)
	print(*ans)


from sys import stdin, stdout
import math
import heapq
t = 1

def aint():
	return int(input().strip())

def lint():
	return list(map(int, input().split()))

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

def main():
	(a, b, c) = lint()
	ans = int(1000000000000.0)
	(aa, bb, cc) = (None, None, None)
	for A in range(1, 10001):
		for B in range(A, 20001, A):
			curr = abs(A - a) + abs(B - b)
			if c <= B:
				curr += B - c
				C = B
			else:
				C = c // B * B
				Cd = C + B
				if c - C > Cd - c:
					C = Cd
					curr += Cd - c
				else:
					curr += c - C
			if curr < ans:
				ans = curr
				aa = A
				bb = B
				cc = C
	print(ans)
	print(aa, bb, cc)
t = int(input())
for i in range(t):
	main()


import atexit
import io
import sys
import math
from collections import defaultdict, Counter
t = int(input())
for i in range(t):
	(a, b, c) = map(int, input().split())
	ans = 10000000
	l = []
	for j in range(1, 2 * a):
		k = 1
		while j * k < 2 * b:
			count = abs(a - j)
			b1 = j * k
			count += abs(b - b1)
			k += 1
			c1 = c
			if b1 <= c:
				d = c % b1
				if d <= b1 // 2:
					c1 -= d
				else:
					c1 += b1 - d
				count += min(d, b1 - d)
			else:
				c1 = b1
				count += b1 - c
			if count < ans:
				ans = count
				l = [j, b1, c1]
	print(ans)
	print(*l)


import random, math
from copy import deepcopy as dc
from bisect import bisect_left, bisect_right

def solution(a, b, c):
	fin = float('inf')
	(A, B, C) = (0, 0, 0)
	for i in range(1, 11000):
		for j in range(i, 11000, i):
			a_f = i + 1 - 1
			b_f = j + 1 - 1
			prev_c = c // b_f * b_f
			nex_c = (c // b_f + 1) * b_f
			op = 0
			if abs(prev_c - c) <= abs(nex_c - c) and prev_c != 0:
				op += abs(prev_c - c)
				c_f = prev_c + 1 - 1
			else:
				op += abs(nex_c - c)
				c_f = nex_c + 1 - 1
			op += abs(a_f - a)
			op += abs(b_f - b)
			if op < fin:
				fin = op + 1 - 1
				(A, B, C) = (a_f, b_f, c_f)
	return [fin, A, B, C]

def input_test():
	for _ in range(int(input())):
		(a, b, c) = map(int, input().strip().split(' '))
		out = solution(a, b, c)
		print(out[0])
		print(*out[1:])

def test():
	pass
input_test()


for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	x = float('inf')
	(s, d, f) = (0, 0, 0)
	w = []
	for i in range(1, 11000):
		for j in range(i, 11000, i):
			for k in range(j, 11000, j):
				t = abs(a - i) + abs(b - j) + abs(c - k)
				if t < x:
					x = t
					(s, d, f) = (i, j, k)
	print(x)
	print(str(s) + ' ' + str(d) + ' ' + str(f))


for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	(a1, a2, a3) = (1, 1, 1)
	a_dist = 999999999999999
	for first in range(1, pow(10, 4) + 1000):
		for second in range(first, pow(10, 4) + 1000, first):
			for third in range(second, pow(10, 4) + 1000, second):
				possibility = (first, second, third)
				current_dist = abs(first - a) + abs(second - b) + abs(third - c)
				if current_dist < a_dist:
					(a1, a2, a3) = (first, second, third)
					a_dist = current_dist
	print(a_dist)
	print(a1, a2, a3)


for testid in range(int(input())):
	(a, b, c) = map(int, input().split())
	(A, B, C) = (0, 0, 0)
	res = 1000000000
	for x in range(1, 2 * a + 1):
		for y in range(x, 2 * b + 1, x):
			for k in range(2):
				z = y * (c // y) + k * y
				temp = abs(a - x) + abs(b - y) + abs(c - z)
				if temp < res:
					res = temp
					(A, B, C) = (x, y, z)
	print(res)
	print(A, B, C)