#include <bits/stdc++.h>
using namespace std;
const int MX = 1e4;
long long a, b, c, A, B, C;
void solve() {
  long long res = INT_MAX;
  cin >> a >> b >> c;
  for (int cA = 1; cA <= (a << 1); ++cA) {
    for (int cB = cA; cB <= (b << 1); cB += cA) {
      for (int i = 0; i < 2; ++i) {
        int cC = ((c / cB) + i) * cB;
        int tmp = abs(cA - a) + abs(cB - b) + abs(cC - c);
        if (tmp < res) {
          A = cA, B = cB, C = cC;
          res = tmp;
        }
      }
    }
  }
  cout << res << "\n" << A << " " << B << " " << C << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
