eval(input())

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



minimum = min(data)

maximum = max(data)

total = sum(data)



print((minimum, maximum, total))
eval(input())

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



print((min(data), max(data), sum(data)))
eval(input())
data = [int(i) for i in input().split()]
minimum = min(data)
maximum = max(data)
total = sum(data)
print((minimum, maximum, total))

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

-minimum = min(data) -maximum = max(data) -total = sum(data) -print((minimum, maximum, total)) +print((min(data), max(data), sum(data)))