#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int a, b, c;
    cin >> a >> b >> c;
    int ans = 1e9, n, m, p;
    for (int i = 1; i <= (a << 1); i++) {
      for (int j = i; j <= (b << 1); j += i) {
        for (int k = 0; k < 2; k++) {
          int A = i, B = j, C, dif;
          C = (B * (c / B)) + (k * B);
          dif = abs(A - a) + abs(B - b) + abs(C - c);
          if (dif < ans) {
            ans = dif;
            n = A, m = B, p = C;
          }
        }
      }
    }
    cout << ans << endl << n << " " << m << " " << p << endl;
  }
}
