#include <bits/stdc++.h>
using namespace std;
const int inf = 0x7ffffff;
int a, b, c;
void solve() {
  cin >> a >> b >> c;
  int ans = inf;
  int ansa, ansb, ansc;
  for (int i = 1; i <= 2 * a; i++) {
    int diva = max(b / i, 1);
    for (int j = 1; j * i <= 2 * b; j++) {
      int tmpb = j * i;
      int divb = max(c / tmpb, 1);
      for (int k = 1; k <= divb + 10; k++) {
        int tmpc = k * tmpb;
        if (ans > abs(a - i) + abs(b - tmpb) + abs(c - tmpc)) {
          ansa = i, ansb = tmpb, ansc = tmpc;
          ans = abs(a - i) + abs(b - tmpb) + abs(c - tmpc);
        }
      }
    }
  }
  cout << ans << "\n";
  cout << ansa << " " << ansb << " " << ansc << "\n";
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int T = 1;
  cin >> T;
  while (T-- > 0) solve();
}
