#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 7;
vector<int> ve[20007];
int main() {
  for (int i = 1; i <= 20000; i++)
    for (int j = i; j <= 20000; j += i) ve[j].push_back(i);
  int T;
  scanf("%d", &T);
  while (T--) {
    int ans = 1e9, a, b, c, ansa, ansb, ansc;
    scanf("%d %d %d", &a, &b, &c);
    for (int i = 1; i <= 20000; i++) {
      int cc = i, bb, aa;
      if (abs(cc - c) >= ans) continue;
      for (int j = 0; j < ve[i].size(); j++) {
        bb = ve[i][j];
        if (abs(cc - c) + abs(bb - b) >= ans) continue;
        for (int k = 0; k < ve[bb].size(); k++) {
          aa = ve[bb][k];
          int zz = abs(aa - a) + abs(bb - b) + abs(cc - c);
          if (zz < ans) {
            ans = zz;
            ansa = aa;
            ansb = bb;
            ansc = cc;
          }
        }
      }
    }
    printf("%d\n", ans);
    printf("%d %d %d\n", ansa, ansb, ansc);
  }
  return 0;
}
