#include <bits/stdc++.h>
using namespace std;
vector<int> v[20001];
struct triplet {
  int x, y, z, sum;
};
int a, b, c;
void init() {
  for (int i = 1; i <= 20000; ++i) {
    for (int j = i; j <= 20000; j += i) v[j].push_back(i);
  }
}
triplet calc(int n) {
  triplet res;
  int ans = 1000000;
  for (int fac : v[n]) {
    int idx = lower_bound(v[fac].begin(), v[fac].end(), a) - v[fac].begin();
    int idx1 = upper_bound(v[fac].begin(), v[fac].end(), a) - v[fac].begin();
    if (idx1 != 0) idx1--;
    if (abs(v[fac][idx1] - a) < abs(v[fac][idx] - a)) idx = idx1;
    int val = abs(v[fac][idx] - a) + abs(fac - b) + abs(n - c);
    if (val < ans) {
      ans = val;
      res.x = v[fac][idx];
      res.y = fac;
      res.z = n;
      res.sum = ans;
    }
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  init();
  int tc;
  cin >> tc;
  while (tc--) {
    cin >> a >> b >> c;
    int ans = 1000000;
    triplet fin;
    for (int i = 1; i <= 20000; ++i) {
      triplet res = calc(i);
      if (res.sum < ans) {
        ans = res.sum;
        fin.x = res.x;
        fin.y = res.y;
        fin.z = res.z;
        fin.sum = res.sum;
      }
    }
    cout << ans << "\n";
    cout << fin.x << " " << fin.y << " " << fin.z << "\n";
  }
  return 0;
}
