#include <bits/stdc++.h>
using namespace std;
long long int power(long long int x, long long int y, long long int p) {
  long long int res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y / 2;
    x = (x * x) % p;
  }
  return res;
}
void solve() {
  long long int a, b, c;
  cin >> a >> b >> c;
  long long int A = -1, B = -1, C = -1;
  long long int curdif = 1e12;
  for (long long int i = 1; i <= 2 * a; i++) {
    for (long long int j = i; j <= 2 * b; j += i) {
      long long int no1 = j * (c / j);
      long long int no2 = j * (c / j) + j;
      long long int dif = abs(a - i) + abs(b - j) + abs(c - no1);
      long long int dif2 = abs(a - i) + abs(b - j) + abs(c - no2);
      if (dif < curdif) {
        curdif = dif;
        A = i, B = j, C = no1;
      } else if (dif2 < curdif) {
        curdif = dif2;
        A = i, B = j, C = no2;
      }
    }
  }
  cout << curdif << "\n";
  cout << A << " " << B << " " << C << "\n";
}
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
