#include <bits/stdc++.h>
using namespace std;
const long long MX = 1000000007;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    long long min = 60000;
    vector<long long> resp(3);
    long long a, b, c;
    cin >> a >> b >> c;
    for (long long i = 1; i <= 20000; i++) {
      for (long long j = i; j <= 20000; j += i) {
        for (long long k = j; k <= 20000; k += j) {
          if (abs(a - i) + abs(b - j) + abs(c - k) < min) {
            resp[0] = i, resp[1] = j, resp[2] = k;
            min = abs(a - i) + abs(b - j) + abs(c - k);
          }
        }
      }
    }
    cout << min << "\n";
    cout << resp[0] << " " << resp[1] << " " << resp[2] << "\n";
  }
}
