#include <bits/stdc++.h>
using namespace std;
bool sortinrev(const pair<long long, long long> &a,
               const pair<long long, long long> &b) {
  return (a.first > b.first);
}
vector<long long> v[20001];
void fc(long long n) {
  for (long long i = 1; i < n + 1; i++) {
    v[i].push_back(1);
    for (long long j = 2; j * j <= i; j++) {
      if (i % j == 0) {
        v[i].push_back(j);
        if (i / j != j) v[i].push_back(i / j);
      }
    }
    if (i != 1) v[i].push_back(i);
  }
}
void sortall() {
  for (long long i = 1; i < 20001; i++) sort(v[i].begin(), v[i].end());
}
void solve() {
  long long a, b, c, m1, m2, m3;
  cin >> a >> b >> c;
  long long ans = 1000000, cnt = 0, k1, k2, k3;
  for (long long i = 1; i < 20001; i++) {
    k2 = i;
    cnt = abs(b - i);
    if (a >= i) {
      k1 = i;
      cnt += a - i;
    } else {
      auto it = lower_bound(v[i].begin(), v[i].end(), a);
      if (it == v[i].end()) {
        it--;
        cnt += abs(*it - a);
        k1 = *it;
      } else if (it == v[i].begin()) {
        k1 = *it;
        cnt += a - *it;
      } else {
        long long v1 = *it;
        long long h1 = abs(*it - a);
        it--;
        long long v2 = *it;
        long long h2 = abs(a - v2);
        if (h1 > h2) {
          k1 = v2;
          cnt += h2;
        } else {
          k1 = v1;
          cnt += h1;
        }
      }
    }
    if (c <= i) {
      k3 = i;
      cnt += abs(i - c);
    } else {
      long long q = c / i;
      long long v1 = i * q;
      long long v2 = i * (q + 1);
      if (c - v1 > v2 - c) {
        k3 = v2;
        cnt += v2 - c;
      } else {
        k3 = v1;
        cnt += c - v1;
      }
    }
    if (ans > cnt) {
      ans = cnt;
      m1 = k1;
      m2 = k2;
      m3 = k3;
    }
  }
  cout << ans << "\n";
  cout << m1 << " " << m2 << " " << m3 << "\n";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  cin >> t;
  fc(20000);
  sortall();
  while (t--) {
    solve();
  }
}
