#include<stdio.h>
int main()
{
int n;
int max;
while(scanf("%d",&max)!=EOF)
{
while(scanf("%d",&n)!=EOF&&n)
{
if(n>max) max=n;
else max=max;
}
printf("%d\n",max);
}
}