MOD = 998244353 n = int(input()) ans = 0 for i, b in enumerate(map(int, input().split())): ans += (pow(2, n - 1, MOD) + pow(2, n - 2, MOD) * i) * b print(ans % MOD)