#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 10;
int a, b, c, x, y, ansa, ansb, ansc;
string s;
vector<vector<int> > D(MAX);
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  for (int i = 1; i < MAX; ++i) {
    for (int j = i; j < MAX; j += i) D[j].push_back(i);
  }
  int t;
  cin >> t;
  while (t--) {
    cin >> a >> b >> c;
    int ans = 1e9;
    for (int i = 1; i < MAX; ++i) {
      int now = abs(b - i), cur = 1e9, cura;
      x = c / i * i;
      y = (c + i - 1) / i * i;
      now += min(abs(x - c), abs(y - c));
      for (auto &j : D[i]) {
        if (abs(j - a) < cur) cur = abs(j - a), cura = j;
      }
      now += cur;
      if (now < ans) {
        ans = now;
        ansa = cura;
        ansb = i;
        if (abs(x - c) <= abs(y - c))
          ansc = x;
        else
          ansc = y;
      }
    }
    cout << ans << "\n";
    cout << ansa << " " << ansb << " " << ansc << "\n";
  }
  return 0;
}
