#include <bits/stdc++.h>
using namespace std;
const int N = 12222;
vector<int> vd[N];
int t, A, B, C, a, b, c, ra, rb, rc, dif, mini;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  for (int i = 1; i < N; ++i)
    for (int j = i; j < N; j += i) vd[j].emplace_back(i);
  cin >> t;
  while (t--) {
    mini = 1e9;
    cin >> A >> B >> C;
    for (int c = N - 1; c; --c)
      for (const int& b : vd[c])
        for (const int& a : vd[b]) {
          dif = abs(A - a) + abs(B - b) + abs(C - c);
          if (dif < mini) mini = dif, ra = a, rb = b, rc = c;
        }
    cout << mini << '\n' << ra << ' ' << rb << ' ' << rc << '\n';
  }
  return 0;
}
