#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long a, b, c;
    scanf("%lld%lld%lld", &a, &b, &c);
    long long ans = 0x7f7f7f7f7f7f7f7f;
    long long ca, cb, cc;
    for (long long i = 1ll; i <= 15000ll; i++) {
      long long a1, c1;
      long long minx1 = 0x7f7f7f7f7f7f7f7f;
      for (long long j = 1; j <= sqrt(i); j++) {
        if (i % j == 0) {
          if (minx1 > abs(i / j - a)) {
            minx1 = abs(i / j - a);
            a1 = i / j;
          }
          if (minx1 > abs(j - a)) {
            minx1 = abs(j - a);
            a1 = j;
          }
        }
      }
      if (abs(max(c / i, 1ll) * i - c) > abs((c / i + 1) * i - c)) {
        c1 = (c / i + 1) * i;
      } else {
        c1 = max(c / i, 1ll) * i;
      }
      if (abs(a1 - a) + abs(i - b) + abs(c1 - c) < ans) {
        ans = abs(a1 - a) + abs(i - b) + abs(c1 - c);
        ca = a1, cb = i, cc = c1;
      }
    }
    printf("%lld\n", ans);
    printf("%lld %lld %lld\n", ca, cb, cc);
  }
}
