#include <bits/stdc++.h>
using namespace std;
#define veryFast ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr)
#define neg cout << -1 << endl
#define Yes cout << "YES" << endl
#define No cout << "NO" << endl
#define input(arr, n) for(int i = 0; i < n; i++) cin >> arr[i];
#define newline cout << endl
using ll = long long;
#define nl '\n'
void solve(){
ll a, b, x;
cin >> a >> b >> x;
//if (a + b < x) {
//cout << a << " " << b << nl;
//return;
//}
if(a >= x){
a-= x;
}else{
b -= (x-a);
a = 0;
}
cout << a << " " << b << nl;
}
int main() {
veryFast;
ll t;
cin >> t;
while (t--) {
solve();
}
return 0;
}