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: introductory

Starter code:

Solutions:
mii = 3*10**4

factors = [set() for _ in range(mii + 1)]
factors[1] = set([1])

for k in range(2, mii + 1):
    for p in range(2, mii + 1):
        if k % p == 0:
            factors[k] = set(ole*p for ole in factors[k//p]) | factors[k//p]
            break
        elif p * p > k:
            factors[k] = set([1, k])
            break

# print(factors[:20])

t = int(input())
for _ in range(t):

    a, b, c = [int(x) for x in input().split()]


    best_score = 10**15
    best_trip = a, b, c

    for k in range(1, mii + 1):
        this_b = k
        if c % this_b < this_b - (c % this_b):
            this_c = this_b * (c // this_b)
        else:
            this_c = this_b * (c // this_b + 1)

        this_c = max(this_c, this_b)

        this_a = -1
        loss_a = 10**15
        for cur_a in factors[this_b]:
            if abs(a - cur_a) < loss_a:
                this_a = cur_a
                loss_a = abs(a - cur_a)

        cur_score = abs(a - this_a) + abs(b - this_b) + abs(c - this_c)
        if cur_score < best_score:
            best_score = cur_score
            best_trip = this_a, this_b, this_c

    print(best_score)
    print(*best_trip)


import sys
input = sys.stdin.readline


def make_divisors(n):
    """自然数nの約数を列挙したリストを出力する
    計算量: O(sqrt(N))
    入出力例: 12 -> [1, 2, 3, 4, 6, 12]
    """
    divisors = []
    for k in range(1, int(n**0.5) + 1):
        if n % k == 0:
            divisors.append(k)
            if k != n // k:
                divisors.append(n // k)
    divisors = sorted(divisors)
    return divisors

div_list = [None] * (10**4 + 30)
for i in range(1, 10**4 + 30):
    div_list[i] = make_divisors(i)

t = int(input())
INF = 10**6
for _ in range(t):
    ans_a = -1
    ans_b = -1
    ans_c = -1
    ans = INF
    a, b, c = list(map(int, input().split()))
    for tmp_b in range(1, 10**4 + 30):
        cost_b = abs(b - tmp_b)
        
        cost_a = INF
        for tmp_a in div_list[tmp_b]:
            if cost_a > abs(a - tmp_a):
                cost_a = abs(a - tmp_a)
                aa = tmp_a
              
        cost_c = INF
        num = c // tmp_b
        cost_c = INF
        if cost_c > abs(c - num * tmp_b):
            cost_c = abs(c - num * tmp_b)
            cc = num * tmp_b
        if cost_c > abs(c - (num+1) * tmp_b):
            cost_c = abs(c - (num+1) * tmp_b)
            cc = (num+1) * tmp_b
        if cost_c > abs(c - (num-1) * tmp_b):
            cost_c = abs(c - (num-1) * tmp_b)
            cc = (num-1) * tmp_b
        tmp_ans = cost_a + cost_b + cost_c
        if ans > tmp_ans:
            ans = tmp_ans
            ans_b = tmp_b
            ans_a = aa
            ans_c = cc
    print(ans)
    print(ans_a, ans_b, ans_c)
   
        
            
        


import bisect

t = int(input())

q = []
ans = [float("inf")] * t
ansabc = [[0] * 3 for i in range(t) ]

for loop in range(t):

    a,b,c = map(int,input().split())
    q.append([a,b,c])

for nb in range(1,30001):

    mlis = []
    now = 1

    while now ** 2 <= nb:
        if now ** 2 == nb:
            mlis.append(now)
            break
        elif nb % now == 0:
            mlis.append(now)
            mlis.append(nb // now)

        now += 1

    mlis.sort()
    mlis.append(float("inf"))

    for i in range(t):

        a,b,c = q[i]

        nans = abs(b-nb)

        if c < nb:
            nans += nb-c
            ansc = nb
        else:

            if c % nb < nb - c%nb:
                ansc = c // nb * nb
            else:
                ansc = c // nb * nb + nb
            nans += min(c % nb , nb - c%nb)

        ind = bisect.bisect_left(mlis,a)

        if abs(a - mlis[ind]) < abs(a - mlis[ind-1]):
            ansa = mlis[ind]
        else:
            ansa = mlis[ind-1]
        nans += min(abs(a - mlis[ind]) , abs(a - mlis[ind-1]))

        if ans[i] > nans:
            ans[i] = nans
            ansabc[i] = [ansa,nb,ansc]

for i in range(t):
    print (ans[i])
    print (" ".join(map(str,ansabc[i])))

import sys

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

def mint():
	return int(minp())

def mints():
	return list(map(int, minp().split()))

f = [[] for i in range(20021)]

for i in range(1,20021):
	for j in range(1,i+1):
		if j * j > i:
			break
		if i % j == 0:
				f[i].append(j)
				if j*j != i:
					f[i].append(i//j)

def solve():
	a,b,c = mints()
	ans = (int(1e9),0,0,0)
	for C in range(1,2*c+10):
		dc = abs(C-c)
		#print(C, f[C])
		for B in f[C]:
			db = abs(B-b)
			for A in f[B]:
				ans = min(ans, (dc+db+abs(A-a),A,B,C))
	print(ans[0])
	print(*ans[1:])

for i in range(mint()):
	solve()


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)


q = int(input())
dz = [set() for i in range(13337)]
dz[1].add(1)
dz[2].add(1)
dz[2].add(2)
for k in range(3,13337):
	i = 2
	cyk = 0
	while i**2 <= k:
		if k%i == 0:
			cyk = 1
			break
		i += 1
	if cyk == 0:
		dz[k].add(1)
		dz[k].add(k)
	else:
		kk = k
		dzi = 1
		while kk%i == 0:
			dzi *= i
			kk//= i
		pom = dz[kk]
		dupa = set()
		for j in pom:
			dupa.add(j*dzi)
		dz[k] = dz[k//i].union(dupa)
for _ in range(q):
	a,b,c = map(int,input().split())
	bestie = [a,b,c]
	best = 34739174893
	def wyn(x,y,z):
		return abs(x-a)+abs(y-b)+abs(z-c)
	for z in range(1,13337):
		if abs(z-c) > best:
			continue
		for y in dz[z]:
			if abs(z-c)+abs(y-b)>best:
				continue
			for x in dz[y]:
				if wyn(x,y,z) < best:
					bestie = [x,y,z]
					best = wyn(x,y,z)
	print(best)
	print(*bestie)

import sys

for _ in range(int(sys.stdin.readline().rstrip())):
    a, b, c = list(map(int, sys.stdin.readline().rstrip().split()))
    re = 99999999
    re_arr = [a, b, c]
    for i in range(1, 10001):
        chk_i = abs(i - a)
        if chk_i > re and i > a:
            break
        j = 1
        while True:
            chk_j = chk_i + abs(b - (i * j))
            if chk_j > re and i * j > b:
                break
            k = 1
            while True:
                chk_k = chk_j + abs(c - (i * j * k))
                if chk_k > re and i * j * k > c:
                    break
                elif chk_k < re:
                    re = chk_k
                    re_arr = [i, i * j, i * j * k]
                k += 1
            j += 1
    print(re)
    for i in re_arr:
        print(i, end=' ')
    print('')