from functools import reduce
n = eval(input())

l = sorted(map(int,input().split()))

print(l[0], l[n-1], reduce(lambda x,y: x+y, l))
n = eval(input())

l = list(map(int,input().split()))

print(min(l), max(l), sum(l))
from functools import reduce

n = eval(input())
l = sorted(map(int, input().split()))
print(l[0], l[n - 1], reduce(lambda x, y: x + y, l))

n = eval(input())
l = list(map(int, input().split()))
print(min(l), max(l), sum(l))

-from functools import reduce - -l = sorted(map(int, input().split())) -print(l[0], l[n - 1], reduce(lambda x, y: x + y, l)) +l = list(map(int, input().split())) +print(min(l), max(l), sum(l))