#include <bits/stdc++.h>
const long base = 151;
const long long MM = 1ll * 1000000007 * 1000000007;
using namespace std;
int BIT(int i, long long x) { return (x & (1 << i)); }
long long ONBIT(int i, long long x) { return (x | (1 << i)); }
long long OFFBIT(int i, long long x) { return (x & ~(1 << i)); }
long long FLIPBIT(int i, long long x) { return (x ^ (1 << i)); }
long long NUMBIT(long long x) { return __builtin_popcount(x); }
template <class T>
T GCD(T a, T b) {
  T r;
  while (b != 0) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
template <class T>
T LCM(T a, T b) {
  return a / GCD(a, b) * b;
}
long a, b, c;
void read() {
  long ans = 1e9;
  cin >> a >> b >> c;
  long _a = a, _b = b, _c = c;
  for (long i = 1; i <= 2e4; i++) {
    for (long j = i; j <= 2e4; j += i) {
      for (long k = j; k <= 2e4; k += j) {
        if (abs(i - a) + abs(j - b) + abs(k - c) < ans) {
          ans = abs(i - a) + abs(j - b) + abs(k - c);
          _a = i, _b = j, _c = k;
        }
      }
    }
  }
  cout << ans << endl;
  cout << _a << " " << _b << " " << _c << endl;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long te;
  cin >> te;
  while (te--) read();
}
