#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long infinity = 1000000000000000000;
const int inf = 1e9 + 5;
bool do_debug = false;
void solve() {
  int a, b, c;
  cin >> a >> b >> c;
  int lim = 2e4;
  int ans = a + b + c;
  array<int, 3> av = {0, 0, 0};
  for (int i = 1; i < lim + 1; i++) {
    int t = abs(a - i);
    for (int j = i; j <= lim; j += i) {
      int T = t + abs(b - j);
      if (c < j) {
        T += abs(c - j);
        if (T < ans) {
          ans = T;
          av = {i, j, j};
        }
      } else {
        int X = abs(c - (j * (c / j))), Y = abs(c - (j * ((c + j - 1) / j)));
        T += min(X, Y);
        int C;
        if (X < Y) {
          C = j * (c / j);
        } else {
          C = j * ((c + j - 1) / j);
        }
        if (T < ans) {
          ans = T;
          av = {i, j, C};
        }
      }
    }
  }
  cout << ans << "\n";
  for (int i = 0; i < 3; i++) cout << av[i] << " ";
  cout << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int q = 1;
  cin >> q;
  while (q-- > 0) {
    solve();
  }
  return 0;
}
