#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
char F[200];
inline void out(long long x) {
  if (x == 0) return (void)(putchar('0'));
  long long tmp = x > 0 ? x : -x;
  if (x < 0) putchar('-');
  int cnt = 0;
  while (tmp > 0) {
    F[cnt++] = tmp % 10 + '0';
    tmp /= 10;
  }
  while (cnt > 0) putchar(F[--cnt]);
}
const int maxn = 2e4, mod = 1e9 + 7;
int t, a, b, c, res;
void AC() {
  t = read();
  while (t--) {
    a = read();
    b = read();
    c = read();
    int resa, resb, resc, maxx = 0x3f3f3f3f;
    for (int i = 1; i <= maxn; i++)
      for (int j = i; j <= maxn; j += i)
        for (int k = j; k <= maxn; k += j) {
          int res = abs(a - i) + abs(b - j) + abs(c - k);
          if (res < maxx) {
            maxx = res;
            resa = i, resb = j, resc = k;
          }
        }
    out(maxx);
    puts("");
    cout << resa << " " << resb << " " << resc << endl;
  }
}
int main() {
  AC();
  return 0;
}
