#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
const int N = 2e4 + 4;
int q;
long long ar[3];
vector<long long> fac[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> q;
  for (int i = 1; i < N; i++) {
    for (int j = 1; j * j <= i; j++) {
      if (i % j == 0) {
        int temp = i / j;
        fac[i].push_back(j);
        if (temp != j) fac[i].push_back(temp);
      }
    }
    sort(fac[i].begin(), fac[i].end());
  }
  while (q--) {
    for (int i = 0; i < 3; i++) {
      cin >> ar[i];
    }
    long long mn = INF;
    long long ans[3];
    for (long long i = 1; i <= 20000; i++) {
      for (long long j : fac[i]) {
        long long k;
        if (ar[0] >= j) {
          k = j;
        } else {
          auto ita = upper_bound(fac[j].begin(), fac[j].end(), ar[0]);
          if (ita == fac[j].begin()) {
            k = (*ita);
          } else {
            auto itb = ita--;
            if (abs((*ita) - ar[0]) < abs((*itb) - ar[0])) {
              k = (*ita);
            } else {
              k = (*itb);
            }
          }
        }
        long long tot = abs(i - ar[2]) + abs(j - ar[1]) + abs(k - ar[0]);
        if (tot < mn) {
          mn = tot;
          ans[0] = k;
          ans[1] = j;
          ans[2] = i;
        }
      }
    }
    cout << mn << '\n';
    cout << ans[0] << " " << ans[1] << " " << ans[2] << '\n';
  }
  return 0;
}
