#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
int q, a, b, c;
vector<array<int, 3>> v;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  for (int a = 1; a <= 10e4; ++a) {
    for (int b = a; b <= 10e4; b += a) {
      for (int c = b; c <= 10e4; c += b) v.push_back({a, b, c});
    }
  }
  cin >> q;
  while (q--) {
    cin >> a >> b >> c;
    array<int, 4> ans = {30000, 0, 0, 0};
    for (auto x : v) {
      int ma = abs(a - x[0]) + abs(b - x[1]) + abs(c - x[2]);
      if (ma < ans[0]) ans = {ma, x[0], x[1], x[2]};
    }
    cout << ans[0] << "\n" << ans[1] << " " << ans[2] << " " << ans[3] << "\n";
  }
}
