#include <bits/stdc++.h>
using namespace std;
long long exp(long long taban, long long us) {
  long long carpan = taban % 1000000007;
  long long temp = us;
  long long res = 1;
  while (temp) {
    if (temp % 2) res = (res * carpan) % 1000000007;
    temp /= 2;
    carpan = (carpan * carpan) % 1000000007;
  }
  return res;
}
long long ebob(long long a, long long b) {
  if (!a) return b;
  return ebob(b % a, a);
}
long long ekok(long long a, long long b) { return (a * b) / ebob(a, b); }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int a, b, c;
    cin >> a >> b >> c;
    int best = 1e9;
    int a1 = a, b1 = b, c1 = c;
    for (int i = 1; i <= 1e4 + 1e3; i++) {
      for (int m = 1; m * m <= i; m++) {
        if (i % m == 0) {
          for (int n = 1; n * n <= m; n++) {
            if (m % n == 0) {
              if (best > abs(i - c) + abs(m - b) + abs(n - a)) {
                best = abs(i - c) + abs(m - b) + abs(n - a);
                a1 = n, b1 = m, c1 = i;
              }
              if (best > abs(i - c) + abs(m - b) + abs(m / n - a)) {
                best = abs(i - c) + abs(m - b) + abs(m / n - a);
                a1 = m / n, b1 = m, c1 = i;
              }
            }
          }
          for (int n = 1; n * n <= i / m; n++) {
            if ((i / m) % n == 0) {
              if (best > abs(i - c) + abs(i / m - b) + abs(n - a)) {
                best = abs(i - c) + abs(i / m - b) + abs(n - a);
                a1 = n, b1 = i / m, c1 = i;
              }
              if (best > abs(i - c) + abs(i / m - b) + abs(i / (n * m) - a)) {
                best = abs(i - c) + abs(i / m - b) + abs(i / (n * m) - a);
                a1 = i / (n * m), b1 = i / m, c1 = i;
              }
            }
          }
        }
      }
    }
    cout << best << "\n";
    cout << a1 << " " << b1 << " " << c1 << "\n";
  }
}
