#include <bits/stdc++.h>
using namespace std;
const int N = 3e4 + 10;
int T, a, b, c, tmp;
vector<int> d[N];
int main() {
  scanf("%d", &T);
  for (int i = 1; i <= 2e4; i++) {
    for (int j = 1; j <= sqrt(i); j++) {
      if (i % j == 0) d[i].push_back(j);
      if (i % j == 0 && i / j != j) d[i].push_back(i / j);
    }
    tmp += d[i].size();
  }
  while (T--) {
    int ans = 1e9, a1 = 0, b1 = 0, c1 = 0;
    scanf("%d%d%d", &a, &b, &c);
    for (int i = 1; i <= 2e4; i++) {
      int sum = abs(i - b), mn = 1e9, pos = 0;
      for (int j = 0; j < d[i].size(); j++)
        if (abs(a - d[i][j]) < mn) mn = abs(a - d[i][j]), pos = d[i][j];
      sum += mn + min(c - c / i * i, c / i * i + i - c);
      if (sum < ans)
        ans = sum, a1 = pos, b1 = i,
        c1 = (c - c / i * i < c / i * i + i - c) ? c / i * i : c / i * i + i;
    }
    printf("%d\n%d %d %d\n", ans, a1, b1, c1);
  }
}
