N = 0 A = [] inv = [] po = [] poinv = [] MOD = 1000000007
defu(v): r = 0 vi = 1 for i inrange(0, N+1): r += A[i] * vi r %= MOD vi *= v vi %= MOD return r
definit(): # init inv global inv inv = [] inv.append(0) inv.append(1) for i inrange(2, N+10): inv.append(((MOD - MOD // i) * inv[MOD%i]) % MOD) # init power global po po = [] po.append(1) for i inrange(1, N+10): po.append( (po[i-1] * i) % MOD )
global poinv poinv = [] poinv.append(1) for i inrange(1, N+10): poinv.append( (poinv[i-1] * inv[i]) % MOD )
deffitn(y, n): r = 0 for i inrange(1, n+1): mul = y[i-1] # 分子 mul *= po[n] * inv[n+1-i] # 分母乘法逆元 mul *= poinv[i-1] * poinv[n-i] if (n - i) % 2 == 1: mul *= -1 mul %= MOD r += mul r %= MOD return (r+MOD)%MOD
defwork(): init() ans = 0 y = [] for v inrange(1, N+1): arr.append(u(v))
for i inrange(1, N+1): r = fitn(y, i) print(r, end=' ') ans += r return ans
defpe(): global N, A N = 10 A = [1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1] print(work())
defmain(): global N, A N = int(input()) A = list(map(int, input().split())) work()