from math import comb mod = 998244353 n = int(input()) a = [*map(int, input().split())] ans = 0 for i, v in enumerate(a): res = 0 if i < n - 1: for j in range(i + 1): res = (res + comb(i, j) * (j + 1) * v) % mod res = (res * pow(2, n - 2 - i, mod)) % mod else: for j in range(n): res = (res + comb(n - 1, j) * (j + 1) * v) % mod ans = (ans + res) % mod print(ans)