import numpy as np
#　まずinput
n = int(input())

#　リストを作る
ll = []

for m in range(n):
    aa=input()
    ll.append(int(aa))
print(n)
print(ll)

for p in range(n):
    s = 0
    for l in range(n):
        s = s+ ll[l]
    s = s - ll[p]
    print(s)