import math
from functools import reduce

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm(numbers):
    return reduce(lcm_base, numbers, 1)

def mod_f(m):
    for i in range(N):
        n = 0
        n += m % a[i]

    return n

a = []
N = int(input())
for i in range(N):
    a.append(int(input()))

print(a)

lcm = lcm(a)
print(lcm)
m = lcm - 1

print(mod_f(m))