#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t, a, b, c, i, j, min = pow(10, 9), A, B, C, count, z, d,
                                  count2, d2;
  cin >> t;
  for (z = 0; z < t; z++) {
    min = pow(10, 9);
    cin >> a >> b >> c;
    for (i = 1; i < 2 * a; i++) {
      for (j = i; j <= 2 * b; j += i) {
        count = 0;
        count2 = 0;
        count += abs(a - i);
        count += abs(b - j);
        d = floor(c / j) * j;
        d2 = d + j;
        count2 = count;
        count += abs(d - c);
        count2 += abs(d2 - c);
        if (count < min || count2 < min) {
          if (count2 < count) {
            A = i;
            B = j;
            C = d2;
            min = count2;
          } else {
            A = i;
            B = j;
            C = d;
            min = count;
          }
        }
      }
    }
    cout << min << endl;
    cout << A << " " << B << " " << C;
    if (z < t - 1) cout << endl;
  }
}
