#include <bits/stdc++.h>
using namespace std;
const long long N = 6e5 + 5, mod = 998244353, inv2 = 499122177, g = 3;
long long ksm(long long f, long long x) {
  long long tot = 1;
  while (x) {
    if (x & 1ll) tot = tot * f % mod;
    f = f * f % mod;
    x >>= 1ll;
  }
  return tot;
}
map<long long, long long> mp;
long long BSGS(long long a, long long p, long long n) {
  mp.clear();
  long long m = ceil(sqrt(p)), tmp = 1;
  for (long long i = 0; i < m; i++) mp[tmp * n % p] = i + 1, tmp = tmp * a % p;
  long long tmpp = tmp;
  for (long long i = 1; i <= m; i++) {
    if (mp[tmpp]) return i * m - mp[tmpp] + 1;
    tmpp = tmpp * tmp % p;
  }
  return -1;
}
long long pr[N];
namespace NTT {
long long A[N], B[N], rev[N];
void pre() {
  for (long long l = 1; l < N; l <<= 1ll) pr[l] = ksm(g, (mod - 1) / (l * 2));
}
long long init(long long n, long long m) {
  memset(rev, 0, sizeof(rev));
  long long lim = 0;
  while ((1ll << lim) <= n + m) lim++;
  for (long long i = 0; i <= (1 << lim) - 1; i++)
    rev[i] = (rev[i >> 1ll] >> 1ll) | ((i & 1ll) << (lim - 1));
  return lim;
}
void ntt(long long *f, long long n, long long opt) {
  for (long long i = 0; i <= n - 1; i++)
    if (i < rev[i]) swap(f[i], f[rev[i]]);
  for (long long l = 1; l < n; l <<= 1ll) {
    long long tmp = pr[l];
    if (opt == -1) tmp = ksm(tmp, mod - 2);
    for (long long i = 0; i <= n - 1; i += l << 1ll) {
      long long omegf = 1;
      for (long long j = 0; j < l; j++) {
        long long x = f[i + j], y = omegf * f[i + j + l] % mod;
        f[i + j] = (x + y) % mod, f[i + j + l] = (x - y + mod) % mod;
        omegf = omegf * tmp % mod;
      }
    }
  }
  if (opt == -1) {
    long long t = ksm(n, mod - 2);
    for (long long i = 0; i <= n - 1; i++) f[i] = f[i] * t % mod;
  }
}
void solve(long long *s, long long *f, long long *g, long long n, long long m) {
  long long lim = init(n, m);
  for (long long i = 0; i <= n; i++) A[i] = f[i];
  for (long long i = 0; i <= m; i++) B[i] = g[i];
  for (long long i = n + 1; i <= (1ll << lim); i++) A[i] = 0;
  for (long long i = m + 1; i <= (1ll << lim); i++) B[i] = 0;
  ntt(A, (1 << lim), 1);
  ntt(B, (1 << lim), 1);
  for (long long i = 0; i <= (1 << lim) - 1; i++) s[i] = A[i] * B[i] % mod;
  ntt(s, (1 << lim), -1);
}
}  // namespace NTT
namespace INV {
long long A[N], B[N], S[N];
void solve(long long *s, long long *f, long long n) {
  memset(S, 0, sizeof(S));
  memset(A, 0, sizeof(A));
  memset(B, 0, sizeof(B));
  S[0] = ksm(f[0], mod - 2);
  long long len;
  for (len = 2; len <= (n << 1ll); len <<= 1ll) {
    long long lim = len << 1ll;
    for (long long i = 0; i < len; i++) A[i] = f[i], B[i] = S[i];
    NTT::init(len, 0);
    NTT::ntt(A, lim, 1);
    NTT::ntt(B, lim, 1);
    for (long long j = 0; j < lim; j++)
      S[j] = (2 * B[j] + mod - A[j] * B[j] % mod * B[j] % mod) % mod;
    NTT::ntt(S, lim, -1);
    for (long long j = len; j < lim; j++) S[j] = 0;
  }
  for (long long i = 0; i <= n; i++) s[i] = S[i];
}
}  // namespace INV
namespace poly {
void Add(long long *s, long long *f, long long *g, long long n, long long m) {
  for (long long i = 0; i <= max(n, m); i++) s[i] = (f[i] + g[i]) % mod;
}
void Del(long long *s, long long *f, long long *g, long long n, long long m) {
  for (long long i = 0; i <= max(n, m); i++) s[i] = (f[i] + mod - g[i]) % mod;
}
void Mult(long long *s, long long *f, long long n, long long k) {
  for (long long i = 0; i <= n; i++) s[i] = (f[i] * k % mod + mod) % mod;
}
void Rev(long long *s, long long *f, long long n) {
  for (long long i = 0; i <= n / 2; i++) swap(f[i], f[n - i]);
}
void Deriv(long long *s, long long *f, long long n) {
  long long A[N];
  A[n] = 0;
  for (long long i = 1; i <= n; i++) A[i - 1] = f[i] * i % mod;
  for (long long i = 0; i <= n; i++) s[i] = A[i];
}
void Limit(long long *s, long long *f, long long n) {
  long long A[N];
  A[0] = 0;
  for (long long i = 0; i <= n - 1; i++)
    A[i + 1] = f[i] * ksm(i + 1, mod - 2) % mod;
  for (long long i = 0; i <= n; i++) s[i] = A[i];
}
void Div(long long *q, long long *r, long long *f, long long *g, long long n,
         long long m) {
  long long A[N], B[N];
  for (long long i = 0; i <= n; i++) A[i] = f[i];
  for (long long i = 0; i <= m; i++) B[i] = g[i];
  Rev(f, f, n);
  Rev(g, g, m);
  INV::solve(g, g, n - m);
  NTT::solve(q, f, g, n, n - m);
  for (long long i = n - m + 1; i <= n + n - m; i++) q[i] = 0;
  Rev(q, q, n - m);
  NTT::solve(B, B, q, m, n - m);
  Del(r, A, B, n, n);
}
void Devide(long long *s, long long *g, long long n, long long f0) {
  long long A[N];
  for (long long i = 0; i <= n; i++) A[i] = g[i];
  A[0] = (mod - f0) % mod;
  for (long long i = 0; i <= n; i++) A[i] = (mod - A[i]) % mod;
  INV::solve(s, A, n);
}
void Ln(long long *s, long long *f, long long n) {
  long long A[N], B[N];
  memset(A, 0, sizeof(A));
  memset(B, 0, sizeof(B));
  for (long long i = 0; i <= n; i++) A[i] = f[i], B[i] = 0;
  Deriv(B, A, n);
  INV::solve(A, A, n);
  NTT::solve(A, A, B, n, n);
  Limit(A, A, n);
  for (long long i = 0; i <= n; i++) s[i] = A[i];
}
void Sqrt(long long *s, long long *f, long long n) {
  long long A[N], B[N], C[N], S[N];
  memset(A, 0, sizeof(A));
  memset(B, 0, sizeof(B));
  memset(C, 0, sizeof(C));
  memset(S, 0, sizeof(S));
  long long p = BSGS(3, 998244353, f[0]);
  S[0] = ksm(3, p / 2);
  long long len;
  for (len = 1; len <= (n << 1ll); len <<= 1ll) {
    long long lim = len << 1ll;
    for (long long i = 0; i < len; i++) A[i] = f[i], B[i] = S[i];
    INV::solve(C, B, len);
    NTT::init(len, 0);
    NTT::ntt(A, lim, 1);
    NTT::ntt(C, lim, 1);
    for (long long j = 0; j < lim; j++) S[j] = A[j] * C[j] % mod;
    NTT::ntt(S, lim, -1);
    for (long long i = 0; i < lim; i++) S[i] = (S[i] + B[i]) % mod * inv2 % mod;
    for (int j = len; j < lim; j++) S[j] = 0;
  }
  for (int i = 0; i <= n; i++) s[i] = S[i];
}
void Exp(long long *s, long long *f, long long n) {
  long long A[N], B[N], C[N], S[N];
  memset(A, 0, sizeof(A));
  memset(B, 0, sizeof(B));
  memset(C, 0, sizeof(C));
  memset(S, 0, sizeof(S));
  S[0] = 1;
  long long len;
  for (len = 2; len <= (n << 1ll); len <<= 1ll) {
    long long lim = len << 1ll;
    for (long long i = 0; i < len; i++) A[i] = f[i], B[i] = S[i];
    Ln(C, B, len - 1);
    for (long long i = 0; i < len; i++) C[i] = (mod - C[i] + A[i]) % mod;
    C[0] = (C[0] + 1) % mod;
    NTT::init(len, 0);
    NTT::ntt(B, lim, 1);
    NTT::ntt(C, lim, 1);
    for (long long j = 0; j < lim; j++) S[j] = B[j] * C[j] % mod;
    NTT::ntt(S, lim, -1);
    for (long long j = len; j < lim; j++) S[j] = 0;
  }
  for (long long i = 0; i <= n; i++) s[i] = S[i];
}
void Pow(long long *s, long long *f, long long n, long long k1, long long k2,
         long long lenk) {
  long long A[N];
  memset(A, 0, sizeof(A));
  long long t = 0;
  while (!f[t]) t++;
  if (lenk > log(n) && t) {
    for (int i = 0; i <= n; i++) s[i] = 0;
    return;
  }
  long long p = ksm(f[t], k2), q = ksm(f[t], mod - 2);
  n -= t;
  for (long long i = 0; i <= n; i++) A[i] = f[i + t] * q % mod;
  Ln(A, A, n);
  Mult(A, A, n, k1);
  Exp(A, A, n);
  for (long long i = 0; i + t * k1 <= n + t; i++)
    s[i + t * k1] = A[i] * p % mod;
}
}  // namespace poly
long long n;
long long F[N] = {0,         0,   0,  24,  4,        144, mod - 4, 348,
                  mod - 128, 240, 28, 188, mod - 68, 16,  0,       4};
long long G[N] = {1,        0,       mod - 4, mod - 8, 1,        mod - 16,
                  10,       mod - 4, 12,      48,      mod - 26, 44,
                  mod - 15, 16,      4,       4,       1};
int main() {
  NTT::pre();
  cin >> n;
  INV::solve(G, G, n);
  NTT::solve(F, F, G, n, n);
  cout << F[n];
}
