#include <bits/stdc++.h>
const int Mod = 998244353;
const int G = 3, iG = 332748118;
const int MS = 1 << 17;
inline int qPow(int b, int e) {
  int a = 1;
  for (; e; e >>= 1, b = (long long)b * b % Mod)
    if (e & 1) a = (long long)a * b % Mod;
  return a;
}
inline int gInv(int b) { return qPow(b, Mod - 2); }
int Inv[MS], Fac[MS], iFac[MS];
inline void Init(int N) {
  Fac[0] = 1;
  for (int i = 1; i < N; ++i) Fac[i] = (long long)Fac[i - 1] * i % Mod;
  iFac[N - 1] = gInv(Fac[N - 1]);
  for (int i = N - 1; i >= 1; --i) iFac[i - 1] = (long long)iFac[i] * i % Mod;
  for (int i = 1; i < N; ++i) Inv[i] = (long long)Fac[i - 1] * iFac[i] % Mod;
}
inline int Binom(int N, int M) {
  if (M < 0 || M > N) return 0;
  return (long long)Fac[N] * iFac[M] % Mod * iFac[N - M] % Mod;
}
int Sz, InvSz, R[MS];
inline int getB(int N) {
  int Bt = 0;
  while (1 << Bt < N) ++Bt;
  return Bt;
}
inline void InitFNTT(int N) {
  int Bt = getB(N);
  if (Sz == (1 << Bt)) return;
  Sz = 1 << Bt, InvSz = Mod - (Mod - 1) / Sz;
  for (int i = 1; i < Sz; ++i) R[i] = R[i >> 1] >> 1 | (i & 1) << (Bt - 1);
}
inline void FNTT(int *A, int Ty) {
  for (int i = 0; i < Sz; ++i)
    if (R[i] < i) std::swap(A[R[i]], A[i]);
  for (int j = 1, j2 = 2; j < Sz; j <<= 1, j2 <<= 1) {
    int wn = qPow(~Ty ? G : iG, (Mod - 1) / j2), w, X, Y;
    for (int i = 0, k; i < Sz; i += j2) {
      for (k = 0, w = 1; k < j; ++k, w = (long long)w * wn % Mod) {
        X = A[i + k], Y = (long long)w * A[i + j + k] % Mod;
        A[i + k] -= (A[i + k] = X + Y) >= Mod ? Mod : 0;
        A[i + j + k] += (A[i + j + k] = X - Y) < 0 ? Mod : 0;
      }
    }
  }
  if (!~Ty)
    for (int i = 0; i < Sz; ++i) A[i] = (long long)A[i] * InvSz % Mod;
}
inline void PolyConv(int *_A, int N, int *_B, int M, int *_C, int tN = -1) {
  if (tN == -1) tN = N + M - 1;
  static int A[MS], B[MS];
  InitFNTT(N + M - 1);
  for (int i = 0; i < N; ++i) A[i] = _A[i];
  for (int i = N; i < Sz; ++i) A[i] = 0;
  for (int i = 0; i < M; ++i) B[i] = _B[i];
  for (int i = M; i < Sz; ++i) B[i] = 0;
  FNTT(A, 1), FNTT(B, 1);
  for (int i = 0; i < Sz; ++i) A[i] = (long long)A[i] * B[i] % Mod;
  FNTT(A, -1);
  for (int i = 0; i < tN; ++i) _C[i] = A[i];
}
const int MN = 50005;
int N, Ans;
int g[MN];
int G0[MN], G1[MN], G2[MN];
int F0[MN], F1[MN], F2[MN];
int Tmp[MN];
void CDQ(int l, int r) {
  if (l == r) {
    F0[l] = (F0[l] + G0[l]) % Mod;
    F1[l] = (F1[l] + G1[l]) % Mod;
    F2[l] = (F2[l] + G2[l]) % Mod;
    return;
  }
  int mid = (l + r) >> 1;
  CDQ(l, mid);
  PolyConv(F0 + l, mid - l + 1, G0, r - l + 1, Tmp + l, r - l + 1);
  for (int i = mid + 1; i <= r; ++i) F0[i] = (F0[i] + Tmp[i]) % Mod;
  PolyConv(F0 + l, mid - l + 1, G1, r - l + 1, Tmp + l, r - l + 1);
  for (int i = mid + 1; i <= r; ++i) F1[i] = (F1[i] + Tmp[i]) % Mod;
  PolyConv(F1 + l, mid - l + 1, G1, r - l + 1, Tmp + l, r - l + 1);
  for (int i = mid + 1; i <= r; ++i) F0[i] = (F0[i] + Tmp[i]) % Mod;
  for (int i = mid + 1; i <= r; ++i) F2[i] = (F2[i] + Tmp[i]) % Mod;
  PolyConv(F1 + l, mid - l + 1, G2, r - l + 1, Tmp + l, r - l + 1);
  for (int i = mid + 1; i <= r; ++i) F1[i] = (F1[i] + Tmp[i]) % Mod;
  PolyConv(F2 + l, mid - l + 1, G2, r - l + 1, Tmp + l, r - l + 1);
  for (int i = mid + 1; i <= r; ++i) F2[i] = (F2[i] + Tmp[i]) % Mod;
  CDQ(mid + 1, r);
}
int main() {
  scanf("%d", &N);
  g[2] = g[0] = 1;
  for (int i = 4; i <= N; ++i) g[i] = (g[i - 2] + g[i - 4]) % Mod;
  for (int i = 1; i <= N; ++i)
    G0[i] = (long long)(i - 1) * (i - 1) * g[i - 1] % Mod;
  for (int i = 2; i <= N; ++i)
    G1[i] = (long long)(i - 1) * (i - 1) * g[i - 2] % Mod;
  for (int i = 3; i <= N; ++i)
    G2[i] = (long long)(i - 1) * (i - 1) * g[i - 3] % Mod;
  CDQ(1, N);
  Ans = (long long)N * (G0[N] + G2[N]) % Mod;
  for (int i = 2; i <= N - 2; ++i)
    Ans = (Ans + ((long long)G0[i] * F0[N - i] + 2ll * G1[i] * F1[N - i] +
                  (long long)G2[i] * F2[N - i]) %
                     Mod * i) %
          Mod;
  printf("%d\n", Ans);
  return 0;
}
