#include<bits/stdc++.h>
using namespace std;
double max(double a,double b,double c,double d)
{
double max=a;
if(b>max)
{
max=b;
}
if(c>max)
{
max=c;
}
if(d>max)
{
max=d;
}
return max;
}
int main()
{
int n;
double a=0.0,b=0.0,c=0.0,d=0.0;
while(cin>>n)
{
if(n==2)
{
cin>>a>>b;
cout<<max(a,b,0.0,0.0)<<endl;
a=0,b=0;
}
else if(n==3)
{
cin>>a>>b>>c;
cout<<max(a,b,c,0.0)<<endl;
a=0,b=0,c=0;
}
else
{
cin>>a>>b>>c>>d;
cout<<max(a,b,c,d)<<endl;
a=b=c=d;
}
}
return 0;
}