#include <bits/stdc++.h>
using namespace std;
const long long N = 3e5 + 5;
struct Ans {
  long long a, b, c;
};
void solve() {
  long long a, b, c;
  cin >> a >> b >> c;
  long long ans = 1e9;
  auto x = Ans{a, b, c};
  for (long long aa = 1; aa <= 2 * a; aa++) {
    for (long long bb = aa; bb <= 2 * b; bb += aa) {
      long long op1 = bb * (c / bb);
      long long op2 = op1 + bb;
      long long diff = abs(a - aa) + abs(b - bb);
      long long y = diff + abs(c - op1);
      long long z = diff + abs(c - op2);
      if (y < ans) {
        ans = y;
        x.a = aa;
        x.b = bb;
        x.c = op1;
      }
      if (z < ans) {
        ans = z;
        x.a = aa;
        x.b = bb;
        x.c = op2;
      }
    }
  }
  cout << ans << '\n';
  cout << x.a << ' ' << x.b << ' ' << x.c << '\n';
}
int main(int argc, char *argv[]) {
  long long t;
  ios::sync_with_stdio(0);
  cin.tie(0);
  std::cout << std::fixed;
  std::cout << std::setprecision(15);
  cin >> t;
  for (long long z = 0; z < (long long)t; ++z) solve();
  return 0;
}
