#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
const int N = 1e6 + 4;
long long me(long long a, long long b) {
  if (b < 0) return 0;
  long long res = 1;
  while (b) {
    if (b & 1) res = (res * a) % mod;
    b >>= 1;
    a = (a * a) % mod;
  }
  return res;
}
int main() {
  int n;
  scanf("%d", &n);
  long long cur = (long long)n - 1;
  long long a[n + 4];
  for (int i = 1; i < n + 1; i++) scanf("%lld", &a[i]);
  long long ans = 0;
  for (int i = 1; i < n + 1; i++) {
    long long val = (cur * me(2, cur - 1)) % mod;
    long long here = (me(2, cur) + val) % mod;
    here = (a[i] * here) % mod;
    ans = (ans + here) % mod;
    cur--;
  }
  printf("%lld", ans);
  return 0;
}
