#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  for (T e : v) {
    os << e << ' ';
  }
  return os;
}
static constexpr ll mod = 998244353LL;
ll powmod(ll a, ll b) {
  if (b == 0) {
    return 1;
  }
  ll tmp = powmod(a, b / 2);
  if (b % 2 == 0) {
    return tmp * tmp % mod;
  } else {
    return a * tmp % mod * tmp % mod;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ll n;
  cin >> n;
  vector<ll> a(n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  ll inv2 = powmod(2, mod - 2), sum = a[0], cur = inv2 * a[0];
  for (int i = 1, two = inv2; i < n; ++i) {
    sum = (sum + cur + two * a[i]) % mod;
    two = (two * inv2) % mod;
    cur = (cur + a[i] * two) % mod;
  }
  cout << (sum * powmod(2, n - 1) % mod) << endl;
  return 0;
}
