#include <bits/stdc++.h>
using namespace std;
int _I() {
  int x;
  scanf("%d", &x);
  return x;
}
struct node {
  int a, b, c, d;
  node(){};
  node(int a, int b) {
    this->a = a;
    this->b = b;
  }
  node(int a, int b, int c, int d) {
    this->a = a;
    this->b = b;
    this->c = c, this->d = d;
  }
  bool operator<(const node &R) const {
    if (a == R.a) {
      return b < R.b;
    }
    return a < R.a;
  }
};
vector<int> v[30], p;
string s;
void solve() {
  int a, b, c;
  cin >> a >> b >> c;
  int ans = INT_MAX;
  int A, B, C;
  for (int i = 1; i <= 20000; i++) {
    for (int j = i; j <= 20000; j += i) {
      int x = j;
      for (int k = -1; k <= 1; k++) {
        int y = c - (c % x);
        y = y + x * k;
        if (y <= 0) continue;
        int aa = abs(a - i) + abs(b - x) + abs(c - y);
        if (aa < ans && i <= x && x <= y) {
          ans = aa;
          A = i;
          B = x;
          C = y;
        }
      }
    }
  }
  cout << ans << "\n";
  cout << A << " " << B << " " << C << "\n";
}
int main() {
  int t = _I();
  while (t--) solve();
  return 0;
}
