#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t, i, it, n, arr[100000];
  cin >> t;
  for (it = 0; it < t; it++) {
    cin >> n;
    for (i = 0; i < n; i++) {
      cin >> arr[i];
    }
    sort(arr, arr + n);
    cout << arr[n - 1] << endl;
  }
}
