#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long a, b, c;
  cin >> a >> b >> c;
  long long mini = 1000000000;
  long long a1 = a, b1 = b, c1 = c;
  for (long long x = 1; x <= 10000; x++) {
    for (long long y = x; y <= 20000; y += x) {
      if (c <= y) {
        if (mini <= abs(a - x) + abs(b - y) + y - c) continue;
        mini = abs(a - x) + abs(b - y) + y - c;
        a1 = x;
        b1 = y;
        c1 = y;
        continue;
      }
      long long r = c % y;
      long long r1 = y - r;
      if (mini > abs(a - x) + abs(b - y) + r) {
        mini = abs(a - x) + abs(b - y) + r;
        a1 = x;
        b1 = y;
        c1 = c - r;
      }
      if (mini > abs(a - x) + abs(b - y) + r1) {
        mini = abs(a - x) + abs(b - y) + r1;
        a1 = x;
        b1 = y;
        c1 = c + r1;
      }
    }
  }
  cout << mini << endl << a1 << " " << b1 << " " << c1 << endl;
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n = 1;
  cin >> n;
  while (n--) {
    solve();
  }
}
