#include <bits/stdc++.h>
using namespace std;
const long long M = 1e9 + 7, N = 20020;
long long mm(long long x, long long y) {
  x %= M, y %= M;
  return (x * y) % M;
}
long long po(long long x, long long y) {
  if (!y) return 1;
  long long a = po(x, y / 2) % M;
  if (y % 2) return mm(a, mm(a, x));
  return mm(a, a);
}
vector<long long> A[N];
void fac() {
  for (long long n = 1; 1 < N ? n < N : n > N; 1 < N ? n += 1 : n -= 1) {
    for (long long i = 1; i * i <= n; i++)
      if (n % i == 0) {
        if (n / i == i)
          A[n].push_back(i);
        else
          A[n].push_back(i), A[n].push_back(n / i);
      }
    sort(A[n].begin(), A[n].end());
  }
}
void solve() {
  long long a, b, c, ans = 1e9, x, y, z;
  cin >> a >> b >> c;
  for (long long i = 1; 1 < 2 * b + 2 ? i < 2 * b + 2 : i > 2 * b + 2;
       1 < 2 * b + 2 ? i += 1 : i -= 1) {
    long long r = *lower_bound(A[i].begin(), A[i].end(), a);
    long long l = *(upper_bound(A[i].begin(), A[i].end(), a) - 1);
    long long cost =
        min(abs(r - a), abs(a - l)) + abs(i - b) + min(c % i, i - c % i);
    if (cost < ans) {
      ans = cost;
      y = i;
      if (abs(r - a) < abs(a - l))
        x = r;
      else
        x = l;
      if (c % i < i - c % i)
        z = c - c % i;
      else
        z = c + (i - c % i);
    }
  }
  cout << ans << "\n" << x << " " << y << " " << z << "\n";
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  fac();
  long long t = 1;
  cin >> t;
  while (t--) solve();
  return 0;
}
