N = int(input()) A = list(map(int, input().split())) mod = 998244353 two = [1] * N for i in range(2, N): two[i] = two[i-1]*2 two[i] %= mod two.reverse() ans = two[0] * A[0] for i in range(1,N): ans += two[i] * A[i] * (i + 2) * two[N-i-1] ans %= mod print(ans)