N = int(eval(input()))

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

mod = 10**9 + 7

 

from fractions import gcd

 

def lcm(a,b):

    return a//gcd(a,b)*b



AA = 1

for i in range(N):

    AA = lcm(AA,A[i])

AA %= mod



ans = 0

for i in range(N):

    ans += AA*pow(A[i],mod-2,mod)

    

print((ans%mod))
N = int(eval(input()))

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

mod = 10**9 + 7

 

def p_prime(n): 

    prime = [2]

    for i in range(3,n+1):

        flag = 0

        for j in prime:

            if i%j == 0:

                flag = 1

                break

            if i**0.5 < j:

                break

        if flag == 0:

            prime.append(i)

    return prime



prime = p_prime(int(mod**0.5+1))

def soinsuu(M):

    a = {}

    for p in prime:

        count = 0

        while M%p ==0:

            count += 1

            M //= p

        if count > 0:

            a[p] = count

    if M != 1:

        a[M] = 1

    return a



from collections import defaultdict

AA = defaultdict(int)



for i in range(N):

    tmp = soinsuu(A[i])

    for j in tmp:

        AA[j] = max(AA[j], tmp[j])

        

L = 1

for i in AA:

    L *= pow(i,AA[i],mod)



ans = 0

for i in range(N):

    ans += L*pow(A[i],mod-2,mod)

    

print((ans%mod))
N = int(eval(input()))
A = list(map(int, input().split()))
mod = 10**9 + 7
from fractions import gcd


def lcm(a, b):
    return a // gcd(a, b) * b


AA = 1
for i in range(N):
    AA = lcm(AA, A[i])
AA %= mod
ans = 0
for i in range(N):
    ans += AA * pow(A[i], mod - 2, mod)
print((ans % mod))

N = int(eval(input()))
A = list(map(int, input().split()))
mod = 10**9 + 7


def p_prime(n):
    prime = [2]
    for i in range(3, n + 1):
        flag = 0
        for j in prime:
            if i % j == 0:
                flag = 1
                break
            if i**0.5 < j:
                break
        if flag == 0:
            prime.append(i)
    return prime


prime = p_prime(int(mod**0.5 + 1))


def soinsuu(M):
    a = {}
    for p in prime:
        count = 0
        while M % p == 0:
            count += 1
            M //= p
        if count > 0:
            a[p] = count
    if M != 1:
        a[M] = 1
    return a


from collections import defaultdict

AA = defaultdict(int)
for i in range(N):
    tmp = soinsuu(A[i])
    for j in tmp:
        AA[j] = max(AA[j], tmp[j])
L = 1
for i in AA:
    L *= pow(i, AA[i], mod)
ans = 0
for i in range(N):
    ans += L * pow(A[i], mod - 2, mod)
print((ans % mod))

-from fractions import gcd -def lcm(a, b): -    return a // gcd(a, b) * b +def p_prime(n): +    prime = [2] +    for i in range(3, n + 1): +        flag = 0 +        for j in prime: +            if i % j == 0: +                flag = 1 +                break +            if i**0.5 < j: +                break +        if flag == 0: +            prime.append(i) +    return prime -AA = 1 +prime = p_prime(int(mod**0.5 + 1)) + + +def soinsuu(M): +    a = {} +    for p in prime: +        count = 0 +        while M % p == 0: +            count += 1 +            M //= p +        if count > 0: +            a[p] = count +    if M != 1: +        a[M] = 1 +    return a + + +from collections import defaultdict + +AA = defaultdict(int) -    AA = lcm(AA, A[i]) -AA %= mod +    tmp = soinsuu(A[i]) +    for j in tmp: +        AA[j] = max(AA[j], tmp[j]) +L = 1 +for i in AA: +    L *= pow(i, AA[i], mod) -    ans += AA * pow(A[i], mod - 2, mod) +    ans += L * pow(A[i], mod - 2, mod)