import random
a = list()
n = int(input())
for i in range(n):
a.append(int(random.randint(-20, 50)))
print(*a)
print("sum = " + str(sum(a)))
print("max - min = " + str(max(a)) + " - " + str(min(a)) + " = " + str(max(a) - min(a)))
import random
a = list()
n = int(input())
for i in range(n):
a.append(int(random.randint(-20, 50)))
print(*a)
print("sum = " + str(sum(a)))
print("max - min = " + str(max(a)) + " - " + str(min(a)) + " = " + str(max(a) - min(a)))