#include <bits/stdc++.h>
using namespace std;
const int IO_MAXCHARS = 1 << 16;
char input_buffer[IO_MAXCHARS + 1];
struct FastReader {
  char *p, *q;
  FastReader() : p(input_buffer), q(input_buffer) {}
  char next_char() {
    if (p >= q) {
      p = input_buffer;
      q = p + fread(input_buffer, 1, IO_MAXCHARS, stdin);
      *q = '\0';
    }
    return *p++;
  }
  template <typename T = int>
  T next_num() {
    char c = firstnws();
    if (c == '-') {
      return -next_unum<T>();
    } else {
      --p;
      return next_unum<T>();
    }
  }
  void next_string(string &buff) {
    buff.clear();
    buff += firstnws();
    char c;
    while (!isspace(c = next_char())) {
      buff += c;
    }
  }
  string next_string() {
    string s;
    next_string(s);
    return s;
  }

 private:
  char firstnws() {
    char c;
    while (isspace(c = next_char()))
      ;
    return c;
  }
  template <typename T>
  T next_unum() {
    char c;
    T ret = firstnws() - '0';
    while (isdigit(c = next_char())) {
      ret = 10 * ret + (c - '0');
    }
    return ret;
  }
} reader;
const long long mod = 998244353;
inline long long modadd(long long a, long long b) {
  a += b;
  if (a >= mod) a -= mod;
  return a;
}
inline long long modmul(long long a, long long b) {
  a *= b;
  if (a >= mod) {
    a %= mod;
  }
  return a;
}
long long fastexp(long long n, long long k) {
  long long ret = 1;
  while (k > 0) {
    if (k & 1) {
      ret = modmul(ret, n);
    }
    k /= 2;
    n = modmul(n, n);
  }
  return ret;
}
int main() {
  long long inv2 = fastexp(2, mod - 2);
  long long n = reader.next_num();
  long long p2 = fastexp(2, n - 2);
  long long sol = 0;
  for (int i = 0; i < n; ++i) {
    long long a = reader.next_num();
    if (i + 1 < n) {
      a = modmul(a, p2);
      a = modmul(a, n - i + 1);
      p2 = modmul(p2, inv2);
    }
    sol = modadd(sol, a);
  }
  cout << sol << '\n';
}
