#include <bits/stdc++.h>
using namespace std;
long long const MOD = 1000000007;
const int Max = 1e4 + 500;
using namespace std;
int main() {
  (ios_base::sync_with_stdio(false), cin.tie(NULL));
  long long n;
  cin >> n;
  while (n--) {
    long long a, b, c, mn = 1e18, a1, a2, a3;
    cin >> a >> b >> c;
    for (long long i = 1; i <= Max; i++) {
      for (long long j = i; j <= Max; j += i) {
        for (long long k = j; k <= Max; k += j) {
          long long t = abs(i - a) + abs(j - b) + abs(k - c);
          if (mn > t) {
            a1 = i;
            a2 = j;
            a3 = k;
            mn = t;
          }
        }
      }
    }
    cout << mn << endl;
    cout << a1 << " " << a2 << " " << a3 << endl;
  }
}
