#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10;
const int mod = 998244353;
int n;
long long a[N];
long long p[N];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%lld", &a[i]);
  long long m = 1;
  p[0] = 1;
  p[1] = 3;
  for (int i = 2; i < n; i++) {
    m = (m << 1) % mod;
    p[i] = m * (i + 2) % mod;
  }
  long long ans = 0;
  for (int i = 0; i < n; i++) ans = (ans + p[n - i - 1] * a[i]) % mod;
  cout << ans << endl;
}
