#include <bits/stdc++.h>
using namespace std;
int T, a, b, c;
int A, B, C, ans;
int main() {
  scanf("%d", &T);
  while (T--) {
    ans = 0x3f3f3f3f;
    scanf("%d%d%d", &a, &b, &c);
    for (int i = 1; i <= 10000; ++i) {
      for (int j = i; j <= 30010; j += i) {
        for (int k = j; k <= 30010; k += j) {
          int cur = abs(i - a) + abs(j - b) + abs(k - c);
          if (cur < ans) {
            ans = cur;
            A = i;
            B = j;
            C = k;
          }
        }
      }
    }
    printf("%d\n%d %d %d\n", ans, A, B, C);
  }
  return 0;
}
