#include <bits/stdc++.h>
using namespace std;
#define optimize() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'
int main() {
optimize();
int t;
cin >> t;
while(t--){
long long l,r,x;
cin >> l >> r >> x;
if(x==0){
long long m=min(l,r);
cout << m << " " << m << endl;
}else if(x<0){
cout << -1 << " " << -1 << endl;
}else if(l>=x && x<=r){
long long maximum=max(l,r);
long long minimum=min(l,r);
long long ans=maximum-minimum;
cout << ans << " " << ans-x << endl;
}else if(l==x && x<=r){
cout << -1 << " " << -1 << endl;
}
}
return 0;
}