n = eval(input())

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

print(("%d %d %d") %(min(xi), max(xi), sum(xi)))
n = eval(input())

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

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

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

-xi = list(map(int, input().split())) -print(("%d %d %d") % (min(xi), max(xi), sum(xi))) +x = list(map(int, input().split())) +print(("%d %d %d") % (min(x), max(x), sum(x)))