#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
long long a, b, c;
long long temp_a, temp_c;
long long fac(long long mid) {
  long long val = abs(a - 1);
  temp_a = 1;
  for (long long i = 1; i * i <= mid; i++) {
    if (mid % i == 0) {
      if (abs(a - i) <= val) temp_a = i;
      val = min(val, abs(a - i));
      if (abs(a - (mid / i)) <= val) temp_a = mid / i;
      val = min(val, abs(a - (mid / i)));
    }
  }
  return val;
}
long long bin(long long mid) {
  long long mul = (c / mid) * mid;
  long long temp = abs(c - mul);
  temp_c = mul;
  mul += mid;
  if (abs(c - mul) <= temp) {
    temp_c = mul;
  }
  temp = min(temp, abs(c - mul));
  return temp;
}
void solve() {
  cin >> a >> b >> c;
  long long final_a = c, final_b = c, final_c = c;
  long long ans = abs(a - c) + abs(b - c);
  for (long long mid = 1; mid < 20001; mid++) {
    long long least = fac(mid);
    long long maxi = bin(mid);
    long long temp = abs(mid - b);
    temp += least + maxi;
    if (temp <= ans) {
      final_a = temp_a;
      final_b = mid;
      final_c = temp_c;
    }
    ans = min(ans, temp);
  }
  cout << ans << "\n";
  cout << final_a << " " << final_b << " " << final_c << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  long long tc;
  cin >> tc;
  while (tc--) {
    solve();
  }
}
