#include <bits/stdc++.h>
using namespace std;
const double PI = atan(1.0) * 4;
const int64_t INF = 100000000000000003;
const int32_t LOG = 21;
const long long int MOD = 998244353;
long long int pow2[1000005];
long long int a[1000005];
int32_t main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  pow2[0] = 1;
  for (long long int i = 1; i < 1000002; i++) {
    pow2[i] = pow2[i - 1] * 2;
    if (pow2[i] >= MOD) pow2[i] -= MOD;
  }
  long long int n;
  cin >> n;
  long long int ans = 0;
  for (long long int i = 1; i < n + 1; i++) cin >> a[i];
  for (long long int i = 1; i < n + 1; i++) {
    long long int val = (pow2[n - i] * a[i]) % MOD;
    ans = ans + val;
    if (ans >= MOD) ans -= MOD;
  }
  for (long long int i = 1; i < n; i++) {
    long long int val = (pow2[n - 1 - i] * a[i]) % MOD;
    val = (val * (n - i)) % MOD;
    ans = ans + val;
    if (ans >= MOD) ans -= MOD;
  }
  cout << ans << '\n';
  return 0;
}
