#include using namespace std; using ll = long long; #define all(a) begin(a), end(a) #define sz(x) (int)((x).size()) #ifdef LOCAL #include "debug.hpp" #else #define debug(...) 42 #endif template struct m32 { static_assert(mod < (1U << 31), "Modulus error!"); using u32 = uint32_t; using u64 = uint64_t; using i64 = int64_t; u32 v = 0; template u32 norm(T v) { return static_cast((v %= mod) < 0 ? mod + v : v); } m32() = default; template m32(T _ = 0) : v(norm(_)) {} ~m32() = default; m32 &operator=(const int &rhs) { return v = norm(rhs), *this; } m32 operator-() const { return v == 0 ? m32(0) : m32(mod - v); } m32 &operator+=(const m32 &rhs) { v += rhs.v; if (v >= mod) v -= mod; return *this; } m32 &operator-=(const m32 &rhs) { if (v < rhs.v) v += mod; v -= rhs.v; return *this; } m32 &operator*=(const m32 &rhs) { v = (u64)v * rhs.v % mod; return *this; } m32 &operator/=(const m32 &rhs) { return *this *= rhs.inv(); } m32 operator+(const m32 &rhs) const { return m32(*this) += rhs; } m32 operator-(const m32 &rhs) const { return m32(*this) -= rhs; } m32 operator*(const m32 &rhs) const { return m32(*this) *= rhs; } m32 operator/(const m32 &rhs) const { return m32(*this) /= rhs; } bool operator==(const m32 &rhs) const { return rhs.v == v; } bool operator!=(const m32 &rhs) const { return rhs.v != v; } m32 pow(i64 n) const { m32 x(*this), res(1); for (; n > 0; n >>= 1, x *= x) { if (n & 1LL) res *= x; } return res; } m32 inv() const { assert(v != 0); return pow(mod - 2); } friend ostream &operator<<(ostream &os, const m32 &m) { return os << m.v; } }; const int mod = 998244353; using mint = m32; void solve() { int n; cin >> n; mint ans = 0; for (int i = 0; i < n; i++) { int x; cin >> x; ans += x; } ans = ans * mint(2).pow(n - 1); cout << ans << '\n'; } int main() { cin.tie(nullptr)->sync_with_stdio(false); int T = 1; // cin >> T; while (T--) solve(); return 0; }