import sys sys.setrecursionlimit(5*10**5) input = sys.stdin.readline from collections import defaultdict, deque, Counter from heapq import heappop, heappush from bisect import bisect_left, bisect_right from math import gcd n = int(input()) a = list(map(int,input().split())) mod= 998244353 x = [1,3] for i in range(2,202020): x.append(x[-1]*2+pow(2,i-1, mod)) x[-1] %= mod ans = 0 for i in range(n): l = i r = n-i-1 tmp = x[l] * x[r] tmp %= mod ans += tmp*a[i] ans %= mod print(ans)