#include <bits/stdc++.h>
using namespace std;
long long n, m, t, l, ans, flag, a1, b1, c1, s;
long long a, b, c;
int main() {
  cin >> t;
  while (t--) {
    cin >> a >> b >> c;
    if (b % a == 0 && c % b == 0) {
      cout << 0 << endl;
      cout << a << " " << b << " " << c << endl;
    } else {
      s = 1e9 + 7;
      for (int i = 1; i <= 10001; i++) {
        for (int j = i; j <= 20002; j += i) {
          for (int k = j; k <= 40004; k += j) {
            if (abs(i - a) + abs(j - b) + abs(k - c) < s) {
              s = abs(i - a) + abs(j - b) + abs(k - c);
              a1 = i;
              b1 = j;
              c1 = k;
            }
          }
        }
      }
      cout << s << endl;
      cout << a1 << " " << b1 << " " << c1 << endl;
    }
  }
}
