#include <bits/stdc++.h>
using namespace std;
template <typename T>
void printvec(vector<T>& vec) {
  for (int i = 0; i < vec.size(); i++) {
    cout << vec[i] << " ";
  }
  cout << endl;
}
long long n, m, maxmoves;
int main() {
  std::ios::sync_with_stdio(false);
  int ttt = 1;
  cin >> ttt;
  while (ttt--) {
    cin >> n >> m >> maxmoves;
    if (maxmoves < max(n, m)) {
      cout << "-1\n";
      continue;
    }
    if ((m + n) % 2 == 0) {
      long long temp = max(m, n);
      long long haha = maxmoves - temp;
      if (haha % 2 == 0)
        cout << maxmoves << "\n";
      else
        cout << maxmoves - 2 << "\n";
      continue;
    }
    cout << maxmoves - 1 << "\n";
  }
  return 0;
}
