#include <bits/stdc++.h>
using namespace std;
long long ans1, ans2, ans3;
long long minx;
long long a, b, c;
long long arr[666666];
long long factor(long long n) {
  arr[0] = 1;
  long long count = 1, num = sqrt(n);
  for (long long i = 2; i <= num; i++) {
    if (!(n % i)) {
      arr[count++] = i;
      arr[count++] = n / i;
    }
  }
  if (n == (num * num)) arr[--count] = 0;
  arr[count++] = n;
  return count;
}
void slove(long long num) {
  long long id1 = 0, id2 = 0, id3 = 0;
  long long m1 = 999999999999999999, m2 = 999999999999999999,
            m3 = 999999999999999999;
  long long M = factor(num);
  if (num % a) {
    for (long long i = 0; i < M; i++) {
      if (m1 > abs(arr[i] - a)) {
        m1 = abs(arr[i] - a);
        id1 = arr[i];
      }
    }
  } else {
    m1 = 0;
    id1 = a;
  }
  id2 = num;
  m2 = abs(num - b);
  if (c % num) {
    for (long long i = 1;; i++) {
      if (m3 > abs(i * num - c)) {
        m3 = abs(i * num - c);
        id3 = i * num;
      }
      if ((i - 1) * num > c) break;
    }
  } else {
    m3 = 0;
    id3 = c;
  }
  if ((m1 + m2 + m3) < minx) {
    minx = m1 + m2 + m3;
    ans1 = id1;
    ans2 = id2;
    ans3 = id3;
  }
  for (long long i = 0; i <= M; i++) arr[i] = 0;
}
signed main() {
  long long _;
  cin >> _;
  while (_--) {
    ans1 = 0, ans2 = 0, ans3 = 0;
    scanf("%lld%lld%lld", &a, &b, &c);
    minx = 999999999999999999;
    for (long long i = 1; i < 20000; i++) {
      slove(i);
    }
    cout << minx << '\n';
    cout << ans1 << " " << ans2 << " " << ans3 << '\n';
  }
  return 0;
}
