#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
int power[1000010], a[1000010];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  power[0] = 1;
  for (int i = 1; i < 1000010; ++i) power[i] = power[i - 1] * 2 % mod;
  int n, ans = 0;
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  ans = a[n];
  for (int i = 1; i < n; ++i)
    ans = (ans + 1LL * a[i] * power[n - i - 1] % mod * (n + 2 - i) % mod) % mod;
  cout << ans << endl;
  return 0;
}
