#include <bits/stdc++.h>
using namespace std;
int n;
int g[50005];
int g0[50005], g1[50005], g2[50005];
int f0[50005], f1[50005], f2[50005];
int A[132000], B[132000], R[132000];
int ans;
int power(int x, int y) {
  int s = 1;
  for (; y; y /= 2, x = 1ll * x * x % 998244353)
    if (y & 1) s = 1ll * s * x % 998244353;
  return s;
}
void FFT(int *a, int n, int f) {
  for (int i = 0; i < n; i++)
    if (i < R[i]) swap(a[i], a[R[i]]);
  for (int d = 1; d < n; d <<= 1) {
    int wn = power(3, (998244353 - 1) / (d << 1));
    if (f == -1) wn = power(wn, 998244353 - 2);
    for (int i = 0; i < n; i += (d << 1))
      for (int j = i, w = 1; j < i + d; j++) {
        int y = 1ll * a[j + d] * w % 998244353;
        a[j + d] = (a[j] + 998244353 - y) % 998244353;
        a[j] = (a[j] + y) % 998244353;
        w = 1ll * w * wn % 998244353;
      }
  }
  if (f == -1) {
    int v = power(n, 998244353 - 2);
    for (int i = 0; i < n; i++) a[i] = 1ll * a[i] * v % 998244353;
  }
}
void push(int *a, int asz, int *b, int bsz, int *c, int cl, int cr) {
  int L = 0;
  for (; (1 << L) <= asz + bsz; L++)
    ;
  int n = (1 << L);
  for (int i = 1; i < n; i++) R[i] = (R[i >> 1] >> 1) | ((i & 1) << (L - 1));
  for (int i = 0; i < n; i++) {
    A[i] = (i < asz ? a[i] : 0);
    B[i] = (i < bsz ? b[i] : 0);
  }
  FFT(A, n, 1);
  FFT(B, n, 1);
  for (int i = 0; i < n; i++) A[i] = 1ll * A[i] * B[i] % 998244353;
  FFT(A, n, -1);
  for (int i = cl; i <= cr; i++) c[i] = (c[i] + A[i]) % 998244353;
}
void solve(int l, int r) {
  if (r - l <= 500) {
    for (int i = l; i <= r; i++) {
      for (int j = l; j < i; j++) {
        f0[i] = (f0[i] + 1ll * f0[j] * g0[i - j] + 1ll * f1[j] * g1[i - j]) %
                998244353;
        f1[i] = (f1[i] + 1ll * f0[j] * g1[i - j] + 1ll * f1[j] * g2[i - j]) %
                998244353;
        f2[i] = (f2[i] + 1ll * f2[j] * g2[i - j] + 1ll * f1[j] * g1[i - j]) %
                998244353;
      }
      f0[i] = (f0[i] + g0[i]) % 998244353;
      f1[i] = (f1[i] + g1[i]) % 998244353;
      f2[i] = (f2[i] + g2[i]) % 998244353;
    }
    return;
  }
  int m = (l + r) / 2;
  solve(l, m);
  push(f0 + l, m - l + 1, g0, r - l + 1, f0 + l, m - l + 1, r - l);
  push(f1 + l, m - l + 1, g1, r - l + 1, f0 + l, m - l + 1, r - l);
  push(f0 + l, m - l + 1, g1, r - l + 1, f1 + l, m - l + 1, r - l);
  push(f1 + l, m - l + 1, g2, r - l + 1, f1 + l, m - l + 1, r - l);
  push(f2 + l, m - l + 1, g2, r - l + 1, f2 + l, m - l + 1, r - l);
  push(f1 + l, m - l + 1, g1, r - l + 1, f2 + l, m - l + 1, r - l);
  solve(m + 1, r);
}
int main() {
  scanf("%d", &n);
  g[0] = g[2] = 1;
  for (int i = 4; i <= n; i += 2) g[i] = (g[i - 4] + g[i - 2]) % 998244353;
  for (int i = 1; i <= n; i++) {
    g0[i + 1] = 1ll * g[i] * i * i % 998244353;
    g1[i + 1] = 1ll * g[i - 1] * i * i % 998244353;
    if (i >= 2) g2[i + 1] = 1ll * g[i - 2] * i * i % 998244353;
  }
  solve(0, n);
  ans = 1ll * (g[n - 1] + g[n - 3]) * (n - 1) * (n - 1) % 998244353 * n %
        998244353;
  for (int i = 2; i <= n - 2; i++) {
    ans = (ans + 1ll * g[i - 1] * (i - 1) * (i - 1) % 998244353 * f0[n - i] %
                     998244353 * i) %
          998244353;
    ans = (ans + 1ll * g[i - 2] * (i - 1) * (i - 1) % 998244353 * f1[n - i] %
                     998244353 * 2 * i) %
          998244353;
    if (i >= 3 && i <= n - 3)
      ans = (ans + 1ll * g[i - 3] * (i - 1) * (i - 1) % 998244353 * f2[n - i] %
                       998244353 * i) %
            998244353;
  }
  printf("%d", ans % 998244353);
}
