#include <bits/stdc++.h>
using namespace std;
const int P=998244353;

long long a,b,c;
long long Ans1;
int Ans2;

void solve() {
	scanf("%lld%lld%lld",&a,&b,&c);
	if (a>b) swap(a,b);
	if (b>c) swap(b,c);
	if (a>b) swap(a,b);
	cout<<a<<b<<c<<endl;
	if (c>=a+b) {
		Ans1=4*a*b,Ans2=1;
	} else {
		Ans1=0,Ans2=0;
		for (int i=0;i<a;i++) Ans1+=(a+b+c<<1)-i*6-1,Ans2+=(a+b+c<<1)-i*6-6;
	}
	printf("%lld %d\n",Ans1,Ans2);
}

int main() {
	freopen("geometry.in","r",stdin);
	freopen("geometry.out","w",stdout);
	int T; cin>>T;
	while (T--) solve();
	return 0;
}
