#include <bits/stdc++.h>   using namespace std;   int main() {     int t;     cin >> t;     while (t--) {       int a, b, c, min_cost, min_a, min_b, min_c;       cin >> a >> b >> c;       if (b % a == 0 && c % b == 0) {         cout << 0 << endl;         cout << a <<     << b <<     << c << endl;       } else {         min_cost = 10000000;         int max = 2 * c;         for (int i = 1; i < max; i++)           for (int j = i; j < max; j += i)             for (int k = j; k < max; k += j)               if (k % j == 0 && j % i == 0) {                 int cost = abs(a - i) + abs(b - j) + abs(c - k);                 if (cost < min_cost) {                   min_cost = cost;                   min_a = i;                   min_b = j;                   min_c = k;                 }               }         cout << min_cost << endl;         cout << min_a <<     << min_b <<     << min_c << endl;       }     }   }   