#include <bits/stdc++.h>
using namespace std;
vector<vector<int>> g(30004);
void preProcess() {
  for (int i = 1; i < 30004; i++) {
    int raiz = ceil(sqrt(i));
    for (int j = 1; j <= raiz; j++) {
      if (i % j == 0) {
        g[i].push_back(j);
        g[i].push_back(i / j);
      }
    }
    sort(g[i].begin(), g[i].end());
  }
}
int solve(int &a, int &b, int &c) {
  int mini = 1e9 + 7;
  int ba, bb, bc;
  for (int i = 1; i < 30004; i++) {
    int currc = abs(c - i);
    int aa, ab, ac;
    ac = i;
    if (i > c && currc > mini) break;
    for (int j = 0; j < g[ac].size(); j++) {
      int currb = currc + abs(b - g[ac][j]);
      ab = g[ac][j];
      if (currb > mini && ab > b) break;
      for (int k = 0; k < g[ab].size(); k++) {
        int aa = g[ab][k];
        int curra = currb + abs(a - g[ab][k]);
        if (curra > mini && aa > a) break;
        if (curra < mini) {
          mini = curra;
          ba = aa;
          bb = ab;
          bc = ac;
        }
      }
    }
  }
  a = ba;
  b = bb;
  c = bc;
  return mini;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  preProcess();
  cin >> t;
  while (t--) {
    int a, b, c;
    cin >> a >> b >> c;
    int ans = solve(a, b, c);
    cout << ans << '\n';
    cout << a << " " << b << " " << c << '\n';
  }
}
