#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 7;
const int mm = 1e4 + 10;
int t, a, b, c;
vector<int> rho[mm + 1];
void getprim() {
  for (int i = 1; i <= mm; i++)
    for (int j = 1; j <= i; j++)
      if (i % j == 0) rho[i].push_back(j);
}
int main() {
  getprim();
  cin >> t;
  while (t--) {
    cin >> a >> b >> c;
    int res = a + b + c, ra = 0, rb = 0, rc = 0;
    for (int i = 1; i <= mm; i++) {
      int tmp = abs(i - b), a1 = inf, fa = -1, fc;
      for (int j = 0; j <= rho[i].size() - 1; j++) {
        int dis = abs(rho[i][j] - a);
        if (a1 > dis) a1 = dis, fa = rho[i][j];
      }
      tmp += a1;
      if (c % i < i - c % i)
        fc = c / i * i;
      else
        fc = c / i * i + i;
      tmp += min(c % i, i - c % i);
      if (tmp < res) {
        res = tmp;
        ra = fa, rb = i, rc = fc;
      }
    }
    cout << res << "\n";
    cout << ra << " " << rb << " " << rc << "\n";
  }
}
