n = eval(input())

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

mn = lis[0]

mx = lis[0]

for t in lis:

	if mn > t:

		mn = t

	if mx < t:

		mx = t

print(mn, mx, sum(lis))
n = eval(input())

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

mn = lis[0]

mx = lis[0]

for t in lis:

	if mn > t:

		mn = t

	if mx < t:

		mx = t

print("%s %s %s" % (mn, mx, sum(lis)))
n = eval(input())
lis = list(map(int, input().split()))
mn = lis[0]
mx = lis[0]
for t in lis:
    if mn > t:
        mn = t
    if mx < t:
        mx = t
print(mn, mx, sum(lis))

n = eval(input())
lis = list(map(int, input().split()))
mn = lis[0]
mx = lis[0]
for t in lis:
    if mn > t:
        mn = t
    if mx < t:
        mx = t
print("%s %s %s" % (mn, mx, sum(lis)))

-print(mn, mx, sum(lis)) +print("%s %s %s" % (mn, mx, sum(lis)))