#include <bits/stdc++.h>
using namespace std;
const int64_t N = 2e4 + 6, M = 1e9 + 7;
int main() {
  ios::sync_with_stdio(false), cin.tie(nullptr);
  int T;
  cin >> T;
  while (T--) {
    int64_t a, b, c, ans = M, A, B, C;
    cin >> a >> b >> c;
    for (int64_t j = 1; j < N; j++) {
      int64_t i = j;
      for (int64_t f = 1; f * f <= j; f++)
        if (j % f == 0) {
          if (abs(f - a) < abs(i - a)) i = f;
          if (abs(j / f - a) < abs(i - a)) i = j / f;
        }
      int64_t r = c % j;
      int64_t re = j - r;
      int64_t k = c - r;
      if (r > re) k += j;
      int64_t x = abs(a - i) + abs(b - j) + abs(c - k);
      if (x < ans) ans = x, A = i, B = j, C = k;
    }
    cout << ans << "\n" << A << " " << B << " " << C << "\n";
  }
  return 0;
}
