#include <bits/stdc++.h>
const unsigned int MOD = 1000000007;
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int T;
  cin >> T;
  while (T--) {
    long long a, b, c;
    cin >> a >> b >> c;
    long long A, B, C;
    long long x, y, z;
    long long ans = LLONG_MAX;
    for (int i = 1; i <= a * 2; i++) {
      x = i;
      long long key = 1;
      while (x * key <= b * 2) {
        y = x * key;
        long long k = (c / y) * y;
        z = min(abs(c - k), abs(c - (k + y)));
        long long sum = z + abs(y - b) + abs(x - a);
        if (sum < ans) {
          A = x;
          B = y;
          C = (abs(c - k) < abs(c - (k + y))) ? k : k + y;
          ans = sum;
        }
        key++;
      }
    }
    cout << ans << "\n" << A << " " << B << " " << C << "\n";
  }
  return 0;
}
