n = int(input())
score = list(map(float, input().split(" ")))
a = max(score)
b = min(score)
c = sum(score)/n
print("%.2f %.2f %.2f" % (a, b, c))
n = int(input())
score = list(map(float, input().split(" ")))
a = max(score)
b = min(score)
c = sum(score)/n
print("%.2f %.2f %.2f" % (a, b, c))