#include <bits/stdc++.h>
using namespace std;
clock_t startTime;
double getTime() { return (double)(clock() - startTime) / CLOCKS_PER_SEC; }
void solve() {
  long long ans = (long long)(1e15);
  long long a, b, c;
  long long aa, ab, ac;
  cin >> a >> b >> c;
  for (long long i = 1; i < (long long)(3e4 + 1); i++) {
    for (long long j = i; j < (long long)(3e4 + 1); j += i) {
      long long al = abs(a - i) + abs(b - j);
      long long c1 = (c / j) * j;
      long long c2 = ((c + j - 1) / j) * j;
      if (c1 > 0 and al + abs(c1 - c) < ans) {
        ans = al + abs(c1 - c);
        aa = i, ab = j, ac = c1;
      }
      if (c2 > 0 and al + abs(c2 - c) < ans) {
        ans = al + abs(c2 - c);
        aa = i, ab = j, ac = c2;
      }
    }
  }
  cout << ans << endl;
  cout << aa << " " << ab << " " << ac << endl;
}
int32_t main() {
  ios_base::sync_with_stdio(false), cin.tie(nullptr), cin.tie(nullptr);
  long long t_c = 1;
  startTime = clock();
  cin >> t_c;
  while (t_c--) solve();
}
