#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define str string
#define ull unsigned long long
#define fi first
#define se second
#define pll pair<ll, ll>
#define pii pair<int, int>
#define pb push_back
#define in insert
#define be begin
#define en end
#define fr front
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define mp(x, y) make_pair(x, y)
#define file(s) do { \
FILE *f = fopen(s".in", "r"); \
if (f) { \
fclose(f); \
freopen(s".in", "r", stdin); \
freopen(s".out", "w", stdout); \
} \
} while (0)
const int N = 3e5 + 5, MOD = 1e9+7;
const int INF = 1e9;
const ll MINF = -1e18;
vector <ll> tree;
void upd(int i, int u, int x, int l, int r){
if(l + 1 == r) {
tree[x] += u;
return;
}
int m = (l + r) / 2;
if(i < m) upd(i, u, x * 2 + 1, l, m);
else upd(i, u, x * 2 + 2, m, r);
tree[x] = max(tree[x * 2 + 1], tree[x * 2 + 2]);
}
ll get(int fnd, int x, int l, int r){
if(l + 1 == r) {
return l;
}
int m = (l + r) / 2;
if(tree[x * 2 + 1] >= fnd) return get(fnd, x * 2 + 1, l, m);
else return get(fnd, x * 2 + 2, m, r);
}
void solve(){
int a, b, c;
cin >> a >> b >> c;
int ans = 0;
if(a % 2 + b % 2 + c % 2 > 0) ans = 1;
ans += a + b + c - (a % 2 + b % 2 + c % 2);
cout << ans << '\n';
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
// file();
int t;
t = 1;
cin >> t;
for(int i = 1; i <= t; i ++) {
// cout << "Case " << i << ":\n";
solve();
}
return 0;
}