#include <bits/stdc++.h>
using namespace std;
template <class T>
T power(T N, T P) {
  return (P == 0) ? 1 : N * power(N, P - 1);
}
void solve() {
  int a, b, c;
  cin >> a >> b >> c;
  int ans = 1e9;
  int A = -1, B = -1, C = -1;
  for (int cA = 1; cA <= 2 * a; ++cA) {
    for (int cB = cA; cB <= 2 * b; cB += cA) {
      for (int i = 0; i < 2; ++i) {
        int cC = cB * (c / cB) + i * cB;
        int res = abs(cA - a) + abs(cB - b) + abs(cC - c);
        if (ans > res) {
          ans = res;
          A = cA;
          B = cB;
          C = cC;
        }
      }
    }
  }
  cout << ans << endl << A << " " << B << " " << C << endl;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
