#include <bits/stdc++.h>
using namespace std;
struct infu {
  long long a, b, c, d;
};
int main() {
  long long tc, x, y, z, mx = 2e18;
  scanf("%lld", &tc);
  infu tmp, ans;
  for (long long cs = 1; cs <= tc; ++cs) {
    mx = 2e18;
    scanf("%lld", &x), scanf("%lld", &y), scanf("%lld", &z);
    for (long long i = 1; i <= 20000; i++) {
      for (long long j = i; j <= 20000; j += i) {
        for (long long k = j; k <= 20000; k += j) {
          tmp.a = i;
          tmp.b = j;
          tmp.c = k;
          tmp.d = abs(x - i) + abs(y - j) + abs(z - k);
          if (tmp.d < mx) {
            mx = tmp.d;
            ans = tmp;
          }
        }
      }
    }
    printf("%lld\n", ans.d);
    printf("%lld %lld %lld\n", ans.a, ans.b, ans.c);
  }
  return 0;
}
