#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    long long a, b, c;
    long long ansa, ansb, ansc;
    long long res = 1e9;
    cin >> a >> b >> c;
    for (long long i = 1; i <= 10000; i++) {
      for (long long j = i; j <= 25000; j += i) {
        long long clc = c / j;
        clc *= j;
        if (abs(clc + j - c) < abs(clc - c)) clc += j;
        if (res > abs(i - a) + abs(b - j) + abs(clc - c)) {
          res = abs(i - a) + abs(b - j) + abs(clc - c);
          ansa = i;
          ansb = j;
          ansc = clc;
        }
      }
    }
    cout << res << "\n";
    cout << ansa << ' ' << ansb << ' ' << ansc << "\n";
  }
}
