ll@t;rep(t){ll@(a,b,c,d,e,f);wt(max(e-b-c,f-a-c,d-a-b,0),min(a,e)+min(b,f)+min(c,d));}