bool = True
max = 0
while bool:
    i = int(input())
    if max < i:
        max = i
    if i == 0:
        bool = False
print(max)

c27a8758b28ad0e6e767bead6ca1c0ad9704e77e
<mask token>

<mask token>
while bool:
    i = int(input())
    if max < i:
        max = i
    if i == 0:
        bool = False
print(max)

bool = True
max = 0
while bool:
    i = int(input())
    if max < i:
        max = i
    if i == 0:
        bool = False
print(max)
