#include <bits/stdc++.h>
using namespace std;
template <class T>
using v2d = vector<vector<T> >;
template <class T>
bool uin(T &a, T b) {
  return a > b ? (a = b, true) : false;
}
template <class T>
bool uax(T &a, T b) {
  return a < b ? (a = b, true) : false;
}
mt19937 rng(chrono::system_clock::now().time_since_epoch().count());
const int maxS = 2e4 + 10;
int a, b, c, ra, rb, rc;
vector<int> divisor[maxS];
void solve() {
  cin >> a >> b >> c;
  int res = 1e9;
  for (int i = 1; i <= (int)(2e4); ++i) {
    int cur = abs(b - i);
    int tmp = 1e9;
    int aa, bb, cc;
    bb = i;
    for (auto &j : divisor[i]) {
      if (tmp > abs(a - j)) {
        tmp = abs(a - j);
        aa = j;
      }
    }
    cur += tmp;
    tmp = 1e9;
    if (c <= i) {
      cur += i - c;
      cc = i;
    } else {
      int k = c / i;
      if (tmp > abs(c - k * i)) {
        tmp = abs(c - k * i);
        cc = k * i;
      }
      if (tmp > abs(c - (k + 1) * i)) {
        tmp = abs(c - (k + 1) * i);
        cc = (k + 1) * i;
      }
      cur += tmp;
    }
    if (res > cur) {
      res = cur;
      ra = aa;
      rb = bb;
      rc = cc;
    }
  }
  cout << res << '\n' << ra << ' ' << rb << ' ' << rc << '\n';
}
void init() {
  for (int i = 1; i <= (int)(2e4); ++i) {
    for (int j = i; j <= 2e4; j += i) {
      divisor[j].emplace_back(i);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  init();
  int T;
  cin >> T;
  while (T--) {
    solve();
  }
  return 0;
}
