#include <bits/stdc++.h>
using namespace std;
const long long int N = 1e2 + 5, mod = 998244353, bit = 60;
long long int power(long long int a, long long int b, long long int m = mod) {
  a %= m;
  long long int res = 1;
  while (b > 0) {
    if (b & 1) {
      res = (res * a) % m;
    }
    b >>= 1;
    a = (a * a) % m;
  }
  return res;
}
signed main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  long long int pro = 1, temp, t, i, j, l, r, n, m, mid, z, k, x, y, rem,
                carry = 0, ind, ans = 0, mx = -LONG_LONG_MAX,
                mn = LONG_LONG_MAX, cnt = 0, curr = 0, prev, next, sum = 0,
                flag = 1, i1 = -1, i2 = -1;
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> k;
    x = power(2, n - i - 1);
    temp = (x * (n - i)) % mod;
    x = power(2, n - i);
    x %= mod;
    temp += x;
    temp %= mod;
    temp *= k;
    temp %= mod;
    ans += temp;
    ans %= mod;
  }
  cout << ans << '\n';
  return 0;
}
