N=int(input()) A=list(map(int,input().split())) p=998244353 def exp(a,b,p): ans,mul,div=1,a,1 for i in range(70): if b//div%2==1: ans*=mul ans%=p mul=mul**2%p div*=2 return ans%p left=[1] l=0 for i in range(1,N+10): left.append((1+i*exp(2,i-1,p)+exp(2,i,p)-1)%p) l=left[-1] ans=0 for i in range(N): ans+=A[i]*left[i]*left[N-1-i]%p print(ans)