n = input()

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

print(('%s %s %s' % (min(x), max(x), sum(x))))
n = list(map(int, input()))

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

print(('%s %s %s' % (min(x), max(x), sum(x))))
n = input()
x = list(map(int, input().split()))
print(("%s %s %s" % (min(x), max(x), sum(x))))

n = list(map(int, input()))
x = list(map(int, input().split()))
print(("%s %s %s" % (min(x), max(x), sum(x))))

-n = input() +n = list(map(int, input()))