#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using pii = pair<int, int>;
const int MAXN = 2e5 + 10;
template <typename T>
istream &operator>>(istream &is, vector<T> &v) {
  for (auto i = begin(v); i != end(v); i++) is >> *i;
  return is;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  for (auto i = begin(v); i != end(v); i++)
    os << *i << (i == end(v) - 1 ? "\n" : " ");
  return os;
}
void read(int &x) {
  x = 0;
  char ch = getchar();
  int pd = 1;
  while (ch < '0' || ch > '9') {
    if (ch == '-') pd = -pd;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  x *= pd;
}
void write(const int &x) {
  char ggg[10001];
  int s = 0;
  int tmp = x;
  if (tmp == 0) {
    putchar('0');
    return;
  }
  if (tmp < 0) {
    tmp = -tmp;
    putchar('-');
  }
  while (tmp > 0) {
    ggg[s++] = tmp % 10 + '0';
    tmp /= 10;
  }
  while (s > 0) {
    putchar(ggg[--s]);
  }
}
void solve() {
  int a, b, c;
  cin >> a >> b >> c;
  int ans = -1, x = a, y = b, z = c;
  for (int i = 1; i <= 20000; ++i) {
    int tmp = abs(b - i);
    int tag = -1;
    int xx = a, yy = i, zz = c;
    for (int j = 1; j * j <= i; ++j) {
      if (i % j == 0) {
        if (tag == -1 || abs(a - j) < tag) tag = abs(a - j), xx = j;
        if (tag == -1 || abs(a - i / j) < tag) tag = abs(a - i / j), xx = i / j;
      }
    }
    tmp += tag;
    if (c < i)
      tmp += i - c, zz = i;
    else if (c > i) {
      if (c - c / i * i < (c / i + 1) * i - c)
        zz = c / i * i;
      else
        zz = (c / i + 1) * i;
      tmp += min(c - c / i * i, (c / i + 1) * i - c);
    }
    if (ans == -1 || tmp < ans) x = xx, y = yy, z = zz, ans = tmp;
  }
  cout << ans << '\n';
  cout << x << " " << y << " " << z << '\n';
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int T = 1;
  cin >> T;
  while (T--) {
    solve();
  }
  return 0;
}
