#include <bits/stdc++.h>
using namespace std;
void work() {
  int a, b, c;
  scanf("%d%d%d", &a, &b, &c);
  int ans = 1e9;
  int A, B, C;
  for (int aa = 1; aa <= 2 * a; aa++) {
    for (int bb = aa; bb <= 2 * b; bb += aa) {
      int cc = c / bb * bb;
      int tmp = abs(aa - a) + abs(bb - b) + abs(cc - c);
      if (tmp < ans) {
        ans = tmp;
        A = aa;
        B = bb;
        C = cc;
      }
      cc = c / bb * bb + bb;
      tmp = abs(aa - a) + abs(bb - b) + abs(cc - c);
      if (tmp < ans) {
        ans = tmp;
        A = aa;
        B = bb;
        C = cc;
      }
    }
  }
  printf("%d\n%d %d %d\n", ans, A, B, C);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int T = 1;
  scanf("%d", &T);
  while (T--) {
    work();
  }
}
