#include <bits/stdc++.h>
const int mod = 998244353;
using namespace std;
const int inf = 1e9 + 7;
const int maxn = 2e5 + 10;
long long int n, m, t, p, sum;
long long int a[maxn], b[maxn], c[maxn];
long long int dp[110][110];
long long int maxx = -1, num = -1;
char str[maxn], s[maxn], ss[maxn];
int main() {
  scanf("%lld", &p);
  while (p--) {
    sum = 0x3f3f3f3f;
    long long int x, y, z, x1, y1, z1;
    scanf("%lld", &x);
    scanf("%lld", &y);
    scanf("%lld", &z);
    for (long long int i = 1; i <= 2e4; i++) {
      for (long long int j = i; j <= 2e4; j += i) {
        for (long long int k = j; k <= 2e4; k += j) {
          long long int res = abs(x - i) + abs(y - j) + abs(z - k);
          if (sum > res) {
            sum = res;
            x1 = i, y1 = j, z1 = k;
          }
        }
      }
    }
    cout << sum << endl;
    cout << x1 << " " << y1 << " " << z1 << endl;
  }
  return 0;
}
