#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char c = getchar();
  while (c != '-' && (c < '0' || c > '9')) c = getchar();
  if (c == '-') f = -1, c = getchar();
  while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
  return f * x;
}
const int maxn = 3e5 + 7;
const int inf = 0x3f3f3f3f;
const int mod = 1e9 + 7;
struct P {
  int a, b, c;
};
vector<P> v;
int x, y, z;
void solve() {
  int a, b, c;
  cin >> a >> b >> c;
  int ans = inf;
  for (P p : v) {
    int tmp = abs(a - p.a) + abs(b - p.b) + abs(c - p.c);
    if (tmp < ans) ans = tmp, x = p.a, y = p.b, z = p.c;
  }
  printf("%d\n%d %d %d\n", ans, x, y, z);
}
int main() {
  for (int i = 1; i <= 20000; ++i)
    for (int j = i; j <= 20000; j += i)
      for (int k = j; k <= 20000; k += j) v.push_back((P){i, j, k});
  int T = read();
  while (T--) solve();
}
