import collections,sys,math,functools,operator,itertools,bisect,heapq,decimal,string,time,random #sys.setrecursionlimit(10**9) #sys.set_int_max_str_digits(0) n = int(input()) # #alist = [] #s = input() #for i in range(n): # alist.append(list(map(int,input().split()))) alist = list(map(int,input().split())) mod = 998244353 ans = 0 for i in range(1,n+1): if i == 1: ans += alist[i-1] * pow(2,n-i-1,mod) ans %= mod continue if i == n: ans += alist[i-1] * pow(2,i-2,mod) * (i+1) ans %= mod continue ans += alist[i-1] * pow(2,i-2,mod) * (i+1) * pow(2,n-i-1,mod) ans %= mod print(ans)