#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
template <typename T>
using ordered_set = tree<T, null_type, less <T>, rb_tree_tag, tree_order_statistics_node_update>;
#define endl '\n'
#define ll long long
#define ld long double
#define ull unsigned long long
#define lcm(a,b) ((a*b)/__gcd(a,b))
#define debug(x) cout << "Debug : " << x << endl;
const double PI = 2 * acos(0.0);
const int MOD = 1000000007;
void solve(){
ll a, b, c;
cin >> a >> b >> c;
ll low = a, high = b;
while (low <= high){
ll mid = low + (high - low) / 2;
ll val = (mid - c);
if (val >= a && val <= b){
cout << mid << ' ' << val << endl;
return;
}
else if (val < a){
low = mid + 1;
}
else{
high = mid - 1;
}
}
cout << -1 << ' ' << -1 << endl;
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
int t;
cin >> t;
while(t--){
solve();
}
}