#include <bits/stdc++.h>
using namespace std;
int a, b, c;
int mmin, ans[3];
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    scanf("%d%d%d", &a, &b, &c);
    mmin = 0x3f3f3f3f;
    int x, y, z;
    for (int i = 1; i <= 11000; i++) {
      y = i;
      x = 1;
      for (int j = 2; j <= sqrt(i); j++) {
        if (i % j == 0) {
          if (abs(j - a) < abs(x - a)) {
            x = j;
          }
          if (abs(i / j - a) < abs(x - a)) {
            x = i / j;
          }
        }
      }
      if (abs(i - a) < abs(x - a)) x = i;
      if (abs(c % y) < abs(c % y - y)) {
        z = c - abs(c % y);
      } else {
        z = c + abs(c % y - y);
      }
      int t = abs(a - x) + abs(b - y) + abs(c - z);
      if (t < mmin) {
        mmin = t;
        ans[0] = x;
        ans[1] = y;
        ans[2] = z;
      }
    }
    printf("%d\n%d %d %d\n", mmin, ans[0], ans[1], ans[2]);
  }
  return 0;
}
