#include <bits/stdc++.h>
#pragma GCC optimize(2)
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline")
int pp[1000201], n, ans, fac[1000201], nn, duan[1000201], top;
inline void qieke() {
  for (register int i = 1; i <= top; ++i) duan[i + top] = duan[i] + n;
  top = (top << 1);
  register int zhi = duan[1] + (nn - duan[top] - 1);
  for (register int i = 2; i <= top; ++i)
    zhi = 1LL * zhi * (duan[i] - duan[i - 1] - 1) % 998244353;
  ans = (ans + zhi) % 998244353;
  top = (top >> 1);
}
inline void dfs(int stp, int qk) {
  if (stp >= nn && qk) {
    qieke();
    return;
  }
  if (pp[stp] != -1) {
    dfs(stp + 1, qk);
    return;
  }
  for (register int j = -2; j <= 2; ++j) {
    register int da = (stp + j + nn) % nn;
    if (da < 0 || da > nn || da == stp) continue;
    if (pp[da] != -1) continue;
    register int dyx = (stp + n) % nn;
    register int dyh = (da + n) % nn;
    if (pp[dyx] != -1 || pp[dyh] != -1) continue;
    pp[da] = stp;
    pp[stp] = da;
    pp[dyx] = dyh;
    pp[dyh] = dyx;
    dfs(stp + 1, qk);
    pp[da] = -1;
    pp[stp] = -1;
    pp[dyx] = -1;
    pp[dyh] = -1;
  }
  register int da = (stp + n) % nn;
  if (pp[da] == -1 && (!top || duan[top] != stp - 1)) {
    pp[da] = stp;
    pp[stp] = da;
    duan[++top] = stp;
    dfs(stp + 1, qk | 1);
    --top;
    pp[da] = -1;
    pp[stp] = -1;
  }
}
const int bia[] = {
    0,         0,         0,         24,        4,         240,       204,
    1316,      2988,      6720,      26200,     50248,     174280,    436904,
    1140888,   3436404,   8348748,   24631232,  64575924,  174658944, 488230244,
    282739095, 583167773, 599201163, 111178790, 470158977, 118436480, 744170002,
    418128853, 620410921, 282515603, 777785540, 59207630,  823529776, 0};
const int bt[] = {0,         4,         8,  998244352, 16, 998244343, 4,
                  998244341, 998244305, 26, 998244309, 15, 998244337, 998244349,
                  998244349, 998244352, 0};
int f[1000201];
int main() {
  for (n = 0; n <= 16; ++n) f[n] = bia[n];
  for (n = 17; n <= 50000; ++n)
    for (register int i = 1; i <= 17; ++i)
      f[n] = (f[n] + 1LL * bt[i - 1] * f[n - i]) % 998244353;
  std::cin >> n;
  std::cout << f[n] << '\n';
}
