hdu2107
/**/
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cctype>
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <vector>
#include <string>
#include <stack>
#include <queue>
typedef long long LL;
using namespace std;
int n;
int a[105];
int main()
{
//freopen("in.txt", "r", stdin);
//freopen("out.txt", "w", stdout);
while(scanf("%d", &n) == 1){
if(!n) break;
int maxx = -0x3f3f3f3f;
for (int i = 1; i <= n; i++){
scanf("%d", &a[i]);
maxx = max(maxx, a[i]);
}
printf("%d\n", maxx);
}
return 0;
}
/**/