#include using namespace std; main() { int T;cin>>T; for(;T--;) { long a,b,c; cin>>a>>b>>c; long ans=b/2*2;b%=2; long t=min(a,c); ans+=t*2;a-=t;c-=t; ans+=c/2;c%=2; ans+=min(a,b); cout<