#include <bits/stdc++.h>
using namespace std;
const int RLEN = (1 << 20) + 1;
inline char gc() {
  static char ibuf[RLEN], *ib, *ob;
  (ib == ob) && (ob = (ib = ibuf) + fread(ibuf, 1, RLEN, stdin));
  return (ib == ob) ? EOF : *ib++;
}
inline int read() {
  char ch = gc();
  int res = 0;
  bool f = 1;
  while (!isdigit(ch)) f ^= ch == '-', ch = gc();
  while (isdigit(ch)) res = res * 10 + (ch ^ 48), ch = gc();
  return f ? res : -res;
}
template <class tp>
inline void chemx(tp &a, tp b) {
  a < b ? a = b : 0;
}
template <class tp>
inline void chemn(tp &a, tp b) {
  a > b ? a = b : 0;
}
const int mod = 998244353, G = 3;
inline int add(int a, int b) { return (a += b) >= mod ? (a - mod) : a; }
inline int dec(int a, int b) {
  a -= b;
  return a + (a >> 31 & mod);
}
inline int mul(int a, int b) {
  static long long r;
  r = 1ll * a * b;
  return (r >= mod) ? (r % mod) : r;
}
inline void Add(int &a, int b) { (a += b) >= mod ? (a -= mod) : 0; }
inline void Dec(int &a, int b) { a -= b, a += a >> 31 & mod; }
inline void Mul(int &a, int b) {
  static long long r;
  r = 1ll * a * b, a = (r >= mod) ? (r % mod) : r;
}
inline int ksm(int a, int b, int res = 1) {
  for (; b; b >>= 1, Mul(a, a)) (b & 1) && (Mul(res, a), 1);
  return res;
}
inline int Inv(int x) { return ksm(x, mod - 2); }
inline int fix(int x) { return (x < 0) ? (x + mod) : x; }
const int C = 18;
int *w[C + 1];
int rev[(1 << C) | 1];
inline void init_rev(int lim) {
  for (int i = 0; i < lim; i++)
    rev[i] = (rev[i >> 1] >> 1) | ((i & 1) * (lim >> 1));
}
inline void init_w() {
  for (int i = 1; i <= C; i++) w[i] = new int[1 << (i - 1)];
  int wn = ksm(G, (mod - 1) / (1 << C));
  w[C][0] = 1;
  for (int i = 1, l = 1 << (C - 1); i < l; i++) w[C][i] = mul(w[C][i - 1], wn);
  for (int i = C - 1; i; i--)
    for (int j = 0, l = 1 << (i - 1); j < l; j++) w[i][j] = w[i + 1][j << 1];
}
inline void ntt(vector<int> &f, int lim, int kd) {
  for (int i = 0; i < lim; i++)
    if (i > rev[i]) swap(f[i], f[rev[i]]);
  for (int l = 1, a0, a1, mid = 1; mid < lim; mid <<= 1, l++)
    for (int i = 0; i < lim; i += mid << 1)
      for (int j = 0; j < mid; j++)
        a0 = f[i + j], a1 = mul(f[i + j + mid], w[l][j]),
        f[i + j] = add(a0, a1), f[i + j + mid] = dec(a0, a1);
  if (kd == -1) {
    reverse(f.begin() + 1, f.begin() + lim);
    for (int i = 0, iv = Inv(lim); i < lim; i++) Mul(f[i], iv);
  }
}
inline vector<int> operator+(vector<int> a, vector<int> b) {
  a.resize(max(a.size(), b.size()));
  for (int i = 0; i < b.size(); i++) Add(a[i], b[i]);
  return a;
}
inline vector<int> operator-(vector<int> a, vector<int> b) {
  a.resize(max(a.size(), b.size()));
  for (int i = 0; i < b.size(); i++) Dec(a[i], b[i]);
  return a;
}
inline vector<int> operator*(vector<int> a, vector<int> b) {
  int deg = a.size() + b.size() - 1, lim = 1;
  if (deg <= 32) {
    vector<int> c(deg, 0);
    for (int i = 0; i < a.size(); i++)
      for (int j = 0; j < b.size(); j++) Add(c[i + j], mul(a[i], b[j]));
    return c;
  }
  while (lim < deg) lim <<= 1;
  init_rev(lim);
  a.resize(lim), b.resize(lim);
  ntt(a, lim, 1), ntt(b, lim, 1);
  for (int i = 0; i < lim; i++) Mul(a[i], b[i]);
  ntt(a, lim, -1), a.resize(deg);
  return a;
}
inline vector<int> Inv(vector<int> a, int deg) {
  vector<int> b(1, Inv(a[0])), c;
  for (int lim = 4; lim < (deg << 2); lim <<= 1) {
    init_rev(lim);
    c.resize(lim >> 1);
    for (int i = 0; i < (lim >> 1); i++) c[i] = (i < a.size()) ? a[i] : 0;
    b.resize(lim), c.resize(lim);
    ntt(b, lim, 1), ntt(c, lim, 1);
    for (int i = 0; i < lim; i++) b[i] = mul(b[i], dec(2, mul(b[i], c[i])));
    ntt(b, lim, -1), b.resize(lim >> 1);
  }
  b.resize(deg);
  return b;
}
const int N = 50004;
vector<int> g1, g2, g0, f1, f2, f0, x1, x2, x3;
int g[N], n;
inline int P(int x) { return mul(x, x); }
int main() {
  n = read();
  init_w();
  g[0] = g[2] = 1, x1.resize(2), x2.resize(3), x3.resize(4);
  x1[1] = 1, x2[2] = 1, x3[3] = 1;
  g1.resize(n + 1), g2.resize(n + 1), g0.resize(n + 1);
  for (int i = 4; i <= n; i += 2) g[i] = add(g[i - 2], g[i - 4]);
  for (int i = 0; i <= n; i += 2)
    g0[i] = mul(g[i], P(i)), g1[i] = mul(g[i], P(i + 1)),
    g2[i] = mul(g[i], P(i + 2));
  vector<int> b = g2, c = g0, d, e;
  c.push_back(0);
  for (int i = c.size() - 1; i; i--) c[i] = c[i - 1];
  c[0] = mod - 1;
  b.resize(n + 4);
  for (int i = b.size() - 1; i >= 3; i--) b[i] = b[i - 3];
  b[2] = b[1] = 0, b[0] = mod - 1;
  d = b, b = b * c, c = g1, c.resize(n + 3);
  for (int i = c.size() - 1; i > 1; i--) c[i] = c[i - 2];
  c[1] = 0, c[0] = 0, c = c * c;
  b = b - c;
  for (int i = 0; i < c.size() - 2; i++) c[i] = c[i + 1];
  c.pop_back();
  b = Inv(b, n + 1);
  f1 = g1 * b;
  f0 = (c - g0 * d) * b;
  for (int i = 0; i < d.size(); i++) d[i] = dec(0, d[i]);
  d = Inv(d, n + 1);
  f2 = g1 * f1;
  f2.push_back(0);
  for (int i = f2.size() - 1; i; i--) f2[i] = f2[i - 1];
  f2[0] = 0;
  f2 = (f2 + g2) * d;
  int ret = mul(mul(add(g[n - 1], g[n - 3]), P(n - 1)), n);
  for (int i = 2; i <= n - 2; i++) {
    int now = mul(g[i - 1], f0[n - i - 1]);
    Add(now, mul(2, mul(g[i - 2], f1[n - i - 2])));
    if (i > 2 && n - i >= 3) Add(now, mul(g[i - 3], f2[n - i - 3]));
    Add(ret, mul(mul(i, P(i - 1)), now));
  }
  cout << ret;
}
