using System;
using static System.Console;
using System.Linq;
using System.Collections.Generic;

class Program
{
    static int NN => int.Parse(ReadLine());
    static int[] NList => ReadLine().Split().Select(int.Parse).ToArray();
    static int[][] NArr(long n) => Enumerable.Repeat(0, (int)n).Select(_ => NList).ToArray();
    public static void Main()
    {
        Solve();
    }
    static void Solve()
    {
        var n = NN;
        var a = NList;
        var mod = 998_244_353;
        var ans = 0L;
        for (var i = 0; i < n; ++i)
        {
            if (i + 1 < n) ans = (ans + (long)a[i] * (i + 2) % mod) % mod;
            else ans = (ans + (long)a[i] * (i + 2) * 2 % mod) % mod;
        }
        ans = ans * 499122177 % mod * 499122177 % mod;
        for (var i = 0; i < n - 1; ++i) ans = ans * 2 % mod;
        WriteLine(ans);
    }
}