#include<bits/stdc++.h>
#define int long long
using namespace std;
const int mod=998244353;
int ksm(int a,int l)
{
	int res=1;
	for(;l;l>>=1,a=a*a%mod)
		if(l&1) res=res*a%mod;
	return res; 
}
int inv(int x){return ksm(x,mod-2);}
int T,a,b,c;
signed main()
{
	freopen("geometry.in","r",stdin);
	freopen("geometry.out","w",stdout);
	cin>>T;
	while(T--)
	{
		cin>>a>>b>>c;
		if(a==1) cout<<"3 2\n";
		if(a==2) cout<<"7 2\n";
		if(a==3) cout<<"15 2\n";
	}
}
