#include <bits/stdc++.h>
using namespace std;

int main() {
	int t;
	cin >> t;
	while(t--){
		int n,x;
		cin >> n;
		vector<int> a;
		for(int i=0;i<n;i++){
			cin >> x;
			if(i == 0 || i % 2 == 0)	a.push_back(x);
		}
		cout << *max_element(a.begin(),a.end()) << endl;
	}
	return 0;
}