#include <bits/stdc++.h>
using namespace std;
const long long N = 9e4;
void solve() {
  long long x, y, z;
  cin >> x >> y >> z;
  long long ans = INT_MAX;
  long long aa = x, bb = y, cc = z;
  for (long long a = 1; a <= N; ++a) {
    for (long long b = a; b <= N; b += a) {
      for (long long c = b; c <= N; c += b) {
        long long cnt = abs(a - x) + abs(b - y) + abs(c - z);
        if (cnt < ans) {
          ans = cnt;
          aa = a, bb = b, cc = c;
        }
      }
    }
  }
  cout << ans << '\n';
  cout << aa << ' ' << bb << ' ' << cc << '\n';
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
