#include <bits/stdc++.h>
using namespace std;
long long a[1000100], mi[1000100], n, ans;
int main() {
  cin >> n;
  mi[0] = 1;
  for (long long i = 1; i <= n; i++) scanf("%lld", &a[i]);
  for (long long i = 1; i <= n + 1; i++)
    mi[i] = mi[i - 1] * 2, mi[i] %= (long long)(998244353);
  for (long long i = 1; i <= n; i++) {
    ans += mi[n - i] * a[i];
    ans %= (long long)(998244353);
    if (i != n)
      ans += ((mi[n - i - 1] * a[i]) % (long long)(998244353)) * (n - i),
          ans %= (long long)(998244353);
  }
  cout << ans;
  return 0;
}
