#include <bits/stdc++.h>
#define F(i,f,t) for(int i=(f),__end=(t);i<=__end;i++)
#define D(i,f,t) for(int i=(f),__end=(t);i>=__end;i--)
#define FV(i,x)  for(int i=0;i<(x).size();i++)
using namespace std;
char re(long long&x)
{
	x=0;
	int f=1;
	char c;
	while(c=getchar(),!isdigit(c))if(c=='-')f=-1;
	while(isdigit(c))x=x*10+c-'0',c=getchar();
	x*=f;
	return c;
}
const int N=10086,M=204444;
typedef int intn[N],intm[M];
long long T,a,b,c;
int main()
{
	freopen("geometry.in","r",stdin);
	freopen("geometry.out","w",stdout);
	re(T);
	while(T--)
	{
		re(a),re(b),re(c);
		a=a*2+1;
		printf("%lld 1\n",a*a-2);
	}
	return 0;
}

