#include <bits/stdc++.h>
using namespace std;
int abs(int x) {
  if (x < 0) return -x;
  return x;
}
int main() {
  int T;
  scanf("%d", &T);
  while (T-- > 0) {
    int a, b, c;
    scanf("%d %d %d", &a, &b, &c);
    int _min = 1e9, ma = 0, mb = 0, mc = 0;
    for (int i = 1; i <= 15000; ++i) {
      int cur = abs(a - i);
      for (int j = 1; i * j <= 15000; ++j) {
        int B = i * j, C;
        if (c - c / B * B < c / B * B + B - c)
          C = c / B * B;
        else
          C = c / B * B + B;
        if (_min > cur + abs(b - B) + abs(C - c)) {
          _min = cur + abs(b - B) + abs(C - c);
          ma = i;
          mb = B;
          mc = C;
        }
      }
    }
    printf("%d\n", _min);
    printf("%d %d %d\n", ma, mb, mc);
  }
  return 0;
}
