# coding: utf-8

# Here your code !

n = int(eval(input()))

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



print((min(a),max(a),sum(a)))
eval(input())

a = [int(i) for i in input().split()]



print((min(a),max(a),sum(a)))
# coding: utf-8
# Here your code !
n = int(eval(input()))
a = list(map(int, input().split()))
print((min(a), max(a), sum(a)))

eval(input())
a = [int(i) for i in input().split()]
print((min(a), max(a), sum(a)))

-# coding: utf-8 -# Here your code ! -n = int(eval(input())) -a = list(map(int, input().split())) +eval(input()) +a = [int(i) for i in input().split()]