MOD = 998244353
N = int(input())
A = list(map(int, input().split()))

ans = 0
for i in range(N):
    l = i * pow(2, i - 1 + MOD - 1, MOD) + pow(2, i, MOD)
    r = (N - i - 1) * pow(2, (N - i - 1) - 1 + MOD - 1, MOD) + pow(2, N - i - 1, MOD)
    ans += l * r * A[i]
    ans %= MOD
print(ans)