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