#include <bits/stdc++.h>
using namespace std;
long long i, j, k, t, a, b, c, l;
long long a1, b1, c1;
long long minn;
int main() {
  cin >> t;
  while (t--) {
    minn = 9999999999;
    cin >> a >> b >> c;
    for (i = 1; i <= 20000; i++) {
      for (j = i; j <= 20000; j += i) {
        for (l = j; l <= 20000; l += j) {
          if (abs(a - i) + abs(b - j) + abs(c - l) < minn) {
            minn = abs(a - i) + abs(b - j) + abs(c - l);
            a1 = i;
            b1 = j;
            c1 = l;
          }
        }
      }
    }
    cout << minn << endl;
    printf("%lld %lld %lld\n", a1, b1, c1);
  }
}
