#define _D321EBUG #include using namespace std; #define endl "\n" typedef long long ll; typedef long double ld; typedef pair pii; typedef pair pll; const long double pi = acos(-1.0); const int INF = 1987654321; // int main(){ #ifdef _DEBUG freopen ("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif ios::sync_with_stdio(false); cin.tie(NULL); int T; cin >> T; while(T--){ unsigned long long a, b, c; cin >> a >> b >> c; // cout << a << " " << b<< " " << c << endl; unsigned long long ans = 0; ans += 2*(b/2); ans += 2 * min(a, c); cout << ans << endl; } return 0; }