def main(): import sys input=sys.stdin.readline mod=998244353 n=int(input()) a=list(map(int,input().split())) p=pow(2,n-2,mod) ans=0 for i in range(n): ans=(ans+a[i]*(p*2+i*p))%mod print(ans) main()