n = int(input()) A = list(map(int, input().split())) mod = 998244353 if n == 1: print(A[0]%mod) exit() ans = 0 for i, a in enumerate(A): ans += (i+2)*a ans %= mod ans *= pow(2, n-2, mod) ans %= mod print(ans)