#include <bits/stdc++.h>
using namespace std;
vector<int> v[20005];
int main() {
  int t;
  cin >> t;
  for (int i = 1; i <= 20000; i++) {
    for (int j = i; j <= 20000; j += i) v[i].push_back(j);
  }
  while (t--) {
    int a, b, c;
    cin >> a >> b >> c;
    int A = a, B = b, C = c;
    int sum = 1e9;
    for (int i = 1; i <= 2 * a; i++) {
      for (int j = 0; j < v[i].size(); j++) {
        if (v[i][j] > 2 * b) break;
        int cc = c / v[i][j] * v[i][j];
        if (sum > abs(i - a) + abs(v[i][j] - b) + abs(cc - c)) {
          sum = abs(i - a) + abs(v[i][j] - b) + abs(cc - c);
          A = i;
          B = v[i][j];
          C = cc;
        }
        cc = c / v[i][j] * v[i][j] + v[i][j];
        if (cc > 20000) continue;
        if (sum > abs(i - a) + abs(v[i][j] - b) + abs(cc - c)) {
          sum = abs(i - a) + abs(v[i][j] - b) + abs(cc - c);
          A = i;
          B = v[i][j];
          C = cc;
        }
      }
    }
    printf("%d\n%d %d %d\n", sum, A, B, C);
  }
  return 0;
}
