#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long a, b, c;
  cin >> a >> b >> c;
  long long ca = 0, cb = 0, cc = 0;
  long long res = 1e9;
  for (long long i = 1; i <= 11000; i++) {
    long long ta = 0, tb = i, tc = 0;
    long long minv = 1e9;
    for (long long j = 1; j * j <= i; j++) {
      if (i % j == 0) {
        long long x = j;
        long long y = i / j;
        if (x <= i && abs(a - x) <= minv) {
          ta = x;
          minv = abs(a - x);
        }
        if (y <= i && abs(a - y) <= minv) {
          ta = y;
          minv = abs(a - y);
        }
      }
    }
    long long d = c / i;
    long long diff = 1e9;
    for (long long j = d; j <= d + 1; j++) {
      if (abs(i * j - c) <= diff) {
        tc = i * j;
        diff = abs(c - tc);
      }
    }
    long long cnt = abs(a - ta) + abs(b - tb) + abs(c - tc);
    if (cnt < res) {
      ca = ta;
      cb = tb;
      cc = tc;
      res = cnt;
    }
  }
  cout << res << endl;
  cout << ca << " " << cb << " " << cc << endl;
}
signed main() {
  long long tc;
  cin >> tc;
  while (tc--) {
    solve();
  }
}
