#include<bits/stdc++.h>
using namespace std;
/*#ifndef ONLINE_JUDGE
#include "DEBUG.h"
#define bug(...) __f (#__VA_ARGS__, __VA_ARGS__)
#endif*/
#define first_in_out ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define int long long int
#define double long double
#define print(a) for(auto x : a) cout << x << " ";
#define printpair(a) for(auto x : a) cout << x.first << " " << x.second<<"\n";
void solve()
{
int n, m, k;
cin >> n >> m >> k;
if (n % 2 == 0 and m % 2 == 0 and k % 2 == 0)
cout << n + m + k << "\n";
else
{
int f = 0;
f += (n % 2 == 0);
f += (m % 2 == 0);
f += (k % 2 == 0);
if (f == 2)
cout << n + m + k << "\n";
else
cout << n + m + k - 1 << "\n";
}
}
int32_t main()
{
first_in_out
int t = 1;
cin >> t;
while (t--)
solve();
}