#include <bits/stdc++.h>
int t, a, b, c;
int main() {
  for (scanf("%d", &t); t--;) {
    int ans = 2147483647, a2, b2, c2;
    scanf("%d%d%d", &a, &b, &c);
    for (int i = 1; i <= 20000; i++) {
      for (int j = i; j <= 20000; j += i) {
        for (int k = j; k <= 20000; k += j) {
          if (j % i == 0 && k % j == 0 &&
              abs(a - i) + abs(b - j) + abs(c - k) < ans) {
            ans = abs(a - i) + abs(b - j) + abs(c - k);
            a2 = i, b2 = j, c2 = k;
          }
        }
      }
    }
    printf("%d\n%d %d %d\n", ans, a2, b2, c2);
  }
  return 0;
}
