#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t;
  cin >> t;
  while (t--) {
    long long int i, j, k, a, b, c, mini = 10000000000000, sum = 0, x, y, z, v;
    cin >> a >> b >> c;
    for (i = 1; i <= c; i++) {
      for (j = i; j <= c + i; j = j + i) {
        if (c % j == 0) {
          k = 0;
          z = c;
        } else if (c % j > j - c % j) {
          k = j - c % j;
          z = c + j - c % j;
        } else {
          k = c % j;
          z = c - c % j;
        }
        sum = abs(a - i) + abs(b - j) + k;
        if (sum < mini) {
          x = i;
          y = j;
          v = z;
          mini = sum;
        }
      }
    }
    cout << mini << '\n' << x << " " << y << " " << v << "\n";
  }
  return 0;
}
