#include #define fi first #define se second #define rep(i,s,n) for (int i = (s); i < (n); ++i) #define rrep(i,n,g) for (int i = (n)-1; i >= (g); --i) #define all(a) a.begin(),a.end() #define rall(a) a.rbegin(),a.rend() #define len(x) (int)(x).size() #define dup(x,y) (((x)+(y)-1)/(y)) #define pb push_back #define eb emplace_back #define Field(T) vector> using namespace std; using ll = long long; using ull = unsigned long long; template using pq = priority_queue,greater>; using P = pair; templatebool chmax(T&a,T b){if(abool chmin(T&a,T b){if(b> a >> b >> c >> d >> e >> f; int ans1 = max(0, a-d-f) + max(0, b-e-d) + max(0, c-f-e); int ans2 = min(a, e) + min(b, f) + min(c, d); cout << ans1 << " " << ans2 << endl; } int main() { int t; cin >> t; while(t--) solve(); return 0; }