#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int maxn = 2e5 + 5;
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    int a, b, c, ans = inf;
    int ea, eb, ec, k;
    scanf("%d%d%d", &a, &b, &c);
    for (int i = 1; i <= 20000; ++i) {
      for (int j = i; j <= 20000; j += i) {
        if (c - c / j * j < (c / j + 1) * j - c)
          k = c / j * j;
        else
          k = (c / j + 1) * j;
        if (k < j) continue;
        if (ans > abs(a - i) + abs(b - j) + abs(c - k)) {
          ea = i, eb = j, ec = k;
          ans = abs(a - i) + abs(b - j) + abs(c - k);
        }
      }
    }
    printf("%d\n%d %d %d\n", ans, ea, eb, ec);
  }
  return 0;
}
