#include <bits/stdc++.h>
using namespace std;
const long long int inf = 5 * (1e+8);
const long long int mod = 1e+9 + 7;
int32_t main() {
  long long int T;
  cin >> T;
  while (T--) {
    long long int a, b, c;
    cin >> a >> b >> c;
    long long int ans = inf;
    long long int p, q, r;
    for (long long int i = 1; i <= 2 * a; i++) {
      for (long long int j = i; j <= 2 * b; j += i) {
        for (auto k : {0, 1}) {
          long long int C = (c / j) * j + j * k;
          long long int cost = abs(i - a) + abs(j - b) + abs(C - c);
          if (cost < ans) {
            ans = cost;
            p = i;
            q = j;
            r = C;
          }
        }
      }
    }
    cout << ans << '\n';
    cout << p << " " << q << " " << r << '\n';
  }
  return 0;
}
