#include "bits/stdc++.h"
using namespace std;
using ll = long long;
#define int ll
using pii = pair<int, int>;
template<typename T> using minHeap = priority_queue<T, vector<T>, greater<T>>;
#define all(x) x.begin(),x.end()
#define V vector
#define size(v) (int(v.size()))
const ll mxn= 2e5+3, inf= 1.5e18,mod= 1e9+7;//998244353;
// iwkms
void pre(){}
void solve() {
int l,r,x;cin>>l>>r>>x;
int p = l, q = p - x;
if (q>=l and q<=r) cout<<p<<" "<<q<<"\n";
else {
p = r; q = p-x;
if (q>=l and q<=r) cout<<p<<" "<<q<<"\n";
else cout<<"-1 -1\n";
}
}
int32_t main()
{
pre();
cin.tie(0)->sync_with_stdio(0);
int t=1;cin>>t;while(t--)
solve();
return 0;
}