#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 998244353LL;
const int maxn = 1e6 + 7;
ll two[maxn];
ll cnt[maxn];
ll a[maxn];
int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  two[0] = 1;
  for (int i = 1; i < maxn; i++) two[i] = two[i - 1] * 2 % MOD;
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  cnt[1] = 1;
  for (int i = 2; i <= n; i++) {
    cnt[i] = two[i - 2] * (i + 1) % MOD;
  }
  ll res = 0;
  for (int i = 1; i <= n; i++) {
    res = res + a[i] * cnt[n - i + 1] % MOD;
    res %= MOD;
  }
  cout << res << '\n';
  return 0;
}
