#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int a, b, c;
  cin >> a >> b >> c;
  long long int ans = 1e18;
  long long int A = -1, B = -1, C = -1;
  for (long long int x = 1; x <= 11000; x++) {
    for (long long int y = x; y <= 11000; y += x) {
      long long int z;
      if (c <= y) {
        z = y;
      } else {
        z = c - c % y;
        long long int temp = abs(z - c);
        z += y;
        if (abs(z - c) > temp) {
          z = c - c % y;
        }
      }
      long long int loc = abs(a - x) + abs(b - y) + abs(z - c);
      if (loc < ans) {
        ans = loc;
        A = x;
        B = y;
        C = z;
      }
    }
  }
  cout << ans << endl;
  cout << A << " " << B << " " << C << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
}
