#include <bits/stdc++.h>
using namespace std;
void solve() {
  int a, b, c;
  cin >> a >> b >> c;
  int best_a = 0;
  int best_b = 0;
  int best_c = 0;
  int wh = INT_MAX;
  for (int A = 1; A <= 2 * a; A++) {
    for (int B = A; B <= 2 * b; B += A) {
      int nr = c % B;
      int fr = B - nr;
      if (c < B) {
        int cdist = abs(B - c);
        if (abs(a - A) + abs(b - B) + cdist < wh) {
          wh = abs(a - A) + abs(b - B) + cdist;
          best_a = A;
          best_b = B;
          best_c = B;
        }
        continue;
      }
      if (abs(a - A) + abs(b - B) + nr < wh) {
        wh = abs(a - A) + abs(b - B) + nr;
        best_a = A;
        best_b = B;
        best_c = c / B * B;
      } else if (abs(a - A) + abs(b - B) + fr < wh) {
        wh = abs(a - A) + abs(b - B) + fr;
        best_a = A;
        best_b = B;
        best_c = c / B * B + B;
      }
    }
  }
  cout << wh << endl;
  cout << best_a << ' ' << best_b << ' ' << best_c << endl;
}
int main() {
  int t;
  cin >> t;
  while (t--) solve();
}
