#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int T;
  cin >> T;
  while (T--) {
    long long int a, b, c;
    cin >> a >> b >> c;
    long long int A, B, C, ans = INT_MAX;
    A = B = C = 0;
    for (long long int i = (1); i < (2 * a + 1); i++) {
      for (long long int j = i; j <= 2 * b; j += i) {
        long long int k1 = (c / j) * j;
        long long int k2 = (c / j) * j + j;
        long long int res1 = abs(a - i) + abs(b - j) + abs(c - k1);
        long long int res2 = abs(a - i) + abs(b - j) + abs(c - k2);
        if (res1 < ans) {
          ans = res1;
          A = i;
          B = j;
          C = k1;
        }
        if (res2 < ans) {
          ans = res2;
          A = i;
          B = j;
          C = k2;
        }
      }
    }
    cout << ans << '\n';
    cout << A << " " << B << " " << C << '\n';
  }
  return 0;
}
