#include <bits/stdc++.h>
using namespace std;
unsigned long long power(unsigned long long a, unsigned long long b) {
  if (b <= 0) return 1;
  unsigned long long x = power(a, b / 2) % 998244353;
  x = (x * x) % 998244353;
  if (b % 2) {
    x = (x * a) % 998244353;
  }
  return x;
}
int main() {
  ios_base::sync_with_stdio(false);
  unsigned long long n;
  cin >> n;
  unsigned long long a[n];
  for (unsigned long long i = 0; i < n; i++) cin >> a[i];
  unsigned long long ans = 0;
  for (unsigned long long i = 0; i < n; i++) {
    unsigned long long x = power(2, n - 1 - i);
    x = (x + ((n - 1 - i) * (power(2, n - 2 - i))) % 998244353) % 998244353;
    ans = (ans + (x * a[i])) % 998244353;
  }
  cout << ans;
}
