import sys

n = int(input())
min = sys.maxsize
max = -sys.maxsize - 1

for i in range(1, n+1):
    number = int(input())
    if number > max:
        max = number
    if number < min:
        min = number

print(f"Max number: {max}")
print(f"Min number: {min}")
