#include <bits/stdc++.h>
using namespace std;
string repeat(string second, int n) {
  string s1 = second;
  for (int i = 1; i < n; i++) second += s1;
  return second;
}
string getString(char x) {
  string second(1, x);
  return second;
}
void optimizeIO() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
int gcd(int a, int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
std::vector<int> prime;
void sv() {
  vector<bool> mark(10001, true);
  mark[0] = mark[1] = false;
  for (int i = 2; i * i < 10001; i++) {
    if (mark[i])
      for (int j = i * i; j < 10001; j += i) mark[j] = false;
  }
  for (int i = 0; i < 10001; i++)
    if (mark[i]) prime.push_back(i);
}
vector<pair<pair<int, int>, int>> ans;
void fnc(int c) {
  for (int j = 1; j < 3 * c; j++) {
    vector<int> v;
    v.push_back(1);
    for (int i = 1; i <= sqrt(j); i++)
      if (j % i == 0) {
        if (j / i == i)
          v.push_back(i);
        else {
          v.push_back(i);
          v.push_back(j / i);
        }
      }
    sort(begin(v), end(v));
    for (int i = 0; i < v.size(); i++) {
      for (int k = i; k < v.size(); k++) {
        if (v[k] == v[i] || v[k] % v[i] == 0) {
          int a = v[i], b = v[k];
          if (j % v[k] == 0) ans.push_back({{a, b}, j});
        }
      }
    }
  }
}
int main() {
  optimizeIO();
  fnc(10001);
  int t;
  cin >> t;
  while (t--) {
    int a, b, c;
    cin >> a >> b >> c;
    int mn = INT_MAX;
    int l = 1, r = 1, bc = 1;
    for (int i = 0; i < ans.size(); i++) {
      if (mn > abs(ans[i].first.first - a) + abs(ans[i].first.second - b) +
                   abs(ans[i].second - c)) {
        l = abs(ans[i].first.first);
        r = abs(ans[i].first.second);
        bc = abs(ans[i].second);
        mn = abs(ans[i].first.first - a) + abs(ans[i].first.second - b) +
             abs(ans[i].second - c);
      }
    }
    cout << mn << endl;
    cout << l << " " << r << " " << bc << endl;
  }
}
