#include <bits/stdc++.h>
using namespace std;
string to_string(const string& s) { return '"' + s + '"'; }
string to_string(const bool b) { return (b ? "true" : "false"); }
string to_string(const char* s) { return to_string((string)s); }
string to_string(const char c) {
  string s = "'";
  s += c;
  s += "'";
  return s;
}
template <class T, class U>
string to_string(const pair<T, U>& p) {
  string s = "(";
  s += to_string(p.first);
  s += ", ";
  s += to_string(p.second);
  s += ")";
  return s;
}
template <class T>
string to_string(const T& a) {
  bool first = true;
  string s = "{";
  for (const auto& x : a) {
    if (!first) {
      s += ", ";
    }
    first = false;
    s += to_string(x);
  }
  s += "}";
  return s;
}
void debug_out() { cerr << '\n'; }
template <class Head, class... Tail>
void debug_out(Head head, Tail... tail) {
  cerr << ' ' << to_string(head);
  debug_out(tail...);
}
using ll = long long;
using ld = long double;
const int mod = 1e9 + 7;
const int inf = 1e9 + 100;
const ll inf64 = 7e18l;
void solve() {
  int a, b, c;
  cin >> a >> b >> c;
  int answer = inf;
  vector<int> answ(3);
  for (int b2 = 1; b2 <= 3e4; ++b2) {
    int ans = inf;
    int aa = -1, cc = -1;
    for (int j = 1; j * j <= b2; ++j) {
      if (b2 % j == 0) {
        if (abs(a - j) < ans) {
          ans = abs(a - j);
          aa = j;
        }
        if (abs(a - b2 / j) < ans) {
          ans = abs(a - b2 / j);
          aa = b2 / j;
        }
      }
    }
    if (b2 > c) {
      ans += (b2 - c);
      cc = b2;
    } else {
      if (c % b2 < b2 - c % b2) {
        ans += c % b2;
        cc = c - (c % b2);
      } else {
        ans += b2 - c % b2;
        cc = c + (b2 - c % b2);
      }
    }
    ans += abs(b2 - b);
    if (answer > ans) {
      answer = ans;
      answ[0] = aa;
      answ[1] = b2;
      answ[2] = cc;
    }
  }
  cout << answer << '\n';
  cout << answ[0] << ' ' << answ[1] << ' ' << answ[2] << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(20);
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
