n = eval(input())

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

a.sort()

print(a[0],a[n-1],sum(a))
n = eval(input())

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

print(min(a),max(a),sum(a))
n = eval(input())
a = list(map(int, input().split()))
a.sort()
print(a[0], a[n - 1], sum(a))

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

-a.sort() -print(a[0], a[n - 1], sum(a)) +print(min(a), max(a), sum(a))