#include <bits/stdc++.h>
using namespace std;
void solve();
int main() {
  int t = 1;
  while (t--) solve();
  return 0;
}
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
const int maxn = 1e6 + 6;
const int mod = 998244353;
int binpow(int a, int n) {
  int r = 1;
  while (n) {
    if (n % 2 == 1) r = (1LL * r * a) % mod;
    n /= 2;
    a = (1LL * a * a) % mod;
  }
  return r;
}
void solve() {
  int n, res = 0, x;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &x);
    res = (res + ((((1LL * binpow(2, n - i - 1) * (n - i + 1)) % mod) *
                   binpow(2, mod - 2)) %
                  mod) *
                     x) %
          mod;
  }
  printf("%d", res);
}
