N = int(input()) a = list(map(int,input().split())) ans = 0 P = 998244353 for i in range(N): i += 1 tmp = pow(2,N-i,P) * (pow(2,i-1,P)+(i-1)*pow(2,i-2,P))%P ans += a[i-1] * tmp ans %= P print(ans)