#include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b,c,d;
cin>>a;
while(a--)
{
cin>>b>>c>>d;
if((b+c<d)||(c+d<b)||(b+d<c)) cout<<0<<endl;
else if(a==b||b==c||a==c) cout<<1<<" "<<1<<endl;
else cout<<1<<" "<<0<<endl;
}
}