#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
namespace IO {
bool REOF = 1;
inline char nc() {
  static char buf[100000], *p1 = buf, *p2 = buf;
  return p1 == p2 && REOF &&
                 (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 == p2)
             ? (REOF = 0, EOF)
             : *p1++;
}
template <class T>
inline bool read(T &x) {
  if (!REOF) return false;
  char c = nc();
  bool f = 0;
  x = 0;
  while (c < '0' || c > '9') c == '-' && (f = 1), c = nc();
  while (c >= '0' && c <= '9') x = (x << 3) + (x << 1) + (c ^ 48), c = nc();
  if (f) x = -x;
  return true;
}
template <typename T, typename... T2>
inline bool read(T &x, T2 &...rest) {
  if (!REOF) return false;
  read(x);
  return read(rest...);
}
inline bool need(char &c) {
  return ((c >= 'a') && (c <= 'z')) || ((c >= '0') && (c <= '9')) ||
         ((c >= 'A') && (c <= 'Z'));
}
inline bool read_str(char *a) {
  if (!REOF) return false;
  while ((*a = nc()) && need(*a) && REOF) ++a;
  *a = '\0';
  return true;
}
inline bool read_dbl(double &x) {
  if (!REOF) return false;
  bool f = 0;
  char ch = nc();
  x = 0;
  while (ch < '0' || ch > '9') {
    f |= (ch == '-');
    ch = nc();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10.0 + (ch ^ 48);
    ch = nc();
  }
  if (ch == '.') {
    double tmp = 1;
    ch = nc();
    while (ch >= '0' && ch <= '9') {
      tmp = tmp / 10.0;
      x = x + tmp * (ch ^ 48);
      ch = nc();
    }
  }
  if (f) x = -x;
  return true;
}
template <class TH>
void _dbg(const char *sdbg, TH h) {
  cerr << sdbg << '=' << h << '\n';
}
template <class TH, class... TA>
void _dbg(const char *sdbg, TH h, TA... a) {
  while (*sdbg != ',') cerr << *sdbg++;
  cerr << '=' << h << ',' << ' ';
  _dbg(sdbg + 1, a...);
}
template <class T>
ostream &operator<<(ostream &os, vector<T> V) {
  os << "[";
  for (auto vv : V) os << vv << ",";
  return os << "]";
}
template <class L, class R>
ostream &operator<<(ostream &os, pair<L, R> P) {
  return os << "(" << P.st << "," << P.nd << ")";
}
}  // namespace IO
using namespace IO;
const int maxn = 1e5 + 5;
const int mod = 998244353;
const int INF = 1e9 + 7;
const double eps = 1e-12;
int dx[4] = {0, 0, 1, -1};
int dy[4] = {1, -1, 0, 0};
int a, b, c, A, B, C;
vector<int> fact[maxn];
void init() {
  for (int i = 1; i <= 2e4 + 5; i++) {
    int bound = sqrt(i);
    fact[i].push_back(-INF);
    fact[i].push_back(INF);
    for (int j = 1; j <= bound; j++) {
      if (i % j == 0) {
        fact[i].push_back(j);
        if (j * j != i) fact[i].push_back(i / j);
      }
    }
    sort((fact[i]).begin(), (fact[i]).end());
  }
}
void solve() {
  read(a, b, c);
  int ans = c - a;
  A = B = C = b;
  for (int i = 1, j, k; i <= 2e4 + 5; i++) {
    if (abs(i - c) >= ans) continue;
    for (int p = 0; p < ((int)(fact[i]).size()); p++) {
      if (p == 0 || p == ((int)(fact[i]).size()) - 1) continue;
      j = fact[i][p];
      int cost = abs(i - c) + abs(j - b);
      if (cost >= ans) continue;
      int pre = *(--upper_bound((fact[j]).begin(), (fact[j]).end(), a));
      int suf = *(lower_bound((fact[j]).begin(), (fact[j]).end(), a));
      if (abs(a - pre) > abs(a - suf)) {
        k = suf;
        cost += abs(a - suf);
      } else {
        k = pre;
        cost += abs(a - pre);
      }
      if (cost < ans) {
        ans = cost;
        C = i;
        B = j;
        A = k;
      }
    }
  }
  printf("%d\n", ans);
  printf("%d %d %d\n", A, B, C);
}
int main() {
  init();
  int _T;
  read(_T);
  for (int _ = 1; _ <= _T; _++) solve();
  return 0;
}
