#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int i, a, b, c, j, k, x, y, z, g = INT_MAX, curr, c1, c2, c3;
    cin >> a >> b >> c;
    for (i = 1; i <= 2 * a; i++) {
      for (j = i; j <= 2 * b; j += i) {
        c1 = (c / j) * j;
        c2 = j * (c / j + 1);
        if (abs(c1 - c) < abs(c2 - c)) {
          curr = abs(a - i) + abs(b - j) + abs(c1 - c);
          c3 = c1;
        } else {
          curr = abs(a - i) + abs(b - j) + abs(c2 - c);
          c3 = c2;
        }
        if (curr < g) {
          g = curr;
          x = i;
          y = j;
          z = c3;
        }
      }
    }
    cout << g << endl;
    cout << x << " " << y << " " << z << endl;
  }
}
