#include <bits/stdc++.h>
using namespace std;
void solve() {
  int a, b, c;
  cin >> a >> b >> c;
  int ans = 100000;
  int A, B, C;
  for (int i = 1; i < 2 * a; i++) {
    for (int j = i; j < 2 * b; j += i) {
      for (int k = 0; k < 2; k++) {
        int l = (c / j) * j + k * j;
        int x = abs(a - i) + abs(b - j) + abs(c - l);
        if (x < ans) {
          ans = x;
          A = i;
          B = j;
          C = l;
        }
      }
    }
  }
  cout << ans << endl;
  cout << A << " " << B << " " << C << endl;
}
int main() {
  int t;
  cin >> t;
  while (t--) solve();
}
