#include <iostream>
using namespace std;
int main(){
int t, a, b, c;
cin >> t;
for(int i=0; i<t; i++){
cin >> a >> b >> c;
if(a+b<=c or a+c<=b or b+c<=a)
cout << "0" << endl;
else if(a+b>c or a+c>b or b+c>a){
if(a==b or a==c or b==c)
cout << "1 1" << endl;
else
cout << "1 0" << endl;
}
}
}