#include <bits/stdc++.h>
using namespace std;
const long long maxn = 2e5 + 2;
const long long maxx = 1e13;
const long long mod = 1e9 + 7;
const long long mod1 = 998244353;
long long kc, n, m;
long long d[27];
long long sl[27][maxn];
struct tk {
  long long a, b, c;
};
vector<tk> ans;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t;
  cin >> t;
  for (int i = 1; i <= 4e4; i++) {
    for (int j = i; j <= 4e4; j += i) {
      for (int k = j; k <= 4e4; k += j) {
        tk ans1;
        ans1.a = i;
        ans1.b = j;
        ans1.c = k;
        ans.push_back(ans1);
      }
    }
  }
  while (t--) {
    long long a, b, c;
    cin >> a >> b >> c;
    long long to1, to2, to3;
    long long res = INT_MAX;
    for (auto to : ans) {
      if (res > abs(to.a - a) + abs(to.b - b) + abs(to.c - c)) {
        res = abs(to.a - a) + abs(to.b - b) + abs(to.c - c);
        to1 = to.a;
        to2 = to.b;
        to3 = to.c;
      }
    }
    cout << res << "\n";
    cout << to1 << " " << to2 << " " << to3 << "\n";
  }
}
