#include <bits/stdc++.h>
const long long MOD = 998244353;
const long long inf = 1000000000000000000;
using namespace std;
long long int modpow(long long int x, long long int n) {
  long long int res = 1;
  while (n > 0) {
    if (n & 1) res = res * x % MOD;
    x = x * x % MOD;
    n >>= 1;
  }
  return res;
}
long long int power(long long int x, long long int n) {
  long long int res = 1;
  while (n > 0) {
    if (n & 1) res = res * x;
    x = x * x;
    n >>= 1;
  }
  return res;
}
void solve() {
  long long int n;
  cin >> n;
  std::vector<long long int> a(n + 1, 0);
  for (int i = 1; i <= n; i++) cin >> a[i];
  long long int ans = 0;
  for (int i = 1; i <= n; i++) {
    ans +=
        (a[i] *
         ((modpow(2, n - i) + ((long long int)n - i) * modpow(2, n - 1 - i)) %
          MOD)) %
        MOD;
    ans %= MOD;
  }
  cout << ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  int t = 1, tt = 1;
  while (tt <= t) {
    solve();
    tt++;
  }
  cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC
       << "ms\n";
}
