#include<bits/stdc++.h>
using namespace std;
#define ll long long
void solve() {
ll l,r,x;
cin >> l >> r >> x;
if(x >= 0) {
if(l + x <= r) cout << l + x << ' ' << l << '\n';
else cout << - 1 << ' ' << - 1 << '\n';
} else {
if(r + x >= l) cout << r + x << ' ' << r << '\n';
else cout << - 1 << ' ' << - 1 << '\n';
}
return;
}
int32_t main() {
ios_base::sync_with_stdio(false);cin.tie(NULL);
int tc = 1;
cin >> tc;
for(int kase = 1; kase <= tc; kase++) {
//cout << "Case " << kase << ": ";
solve();
}
return 0;
}