#include <bits/stdc++.h>
using namespace std;
long long read() {
  long long x = 0, f = 0;
  char ch = getchar();
  while (!isdigit(ch)) f = ch == '-', ch = getchar();
  while (isdigit(ch)) x = (x << 1) + (x << 3) + (ch ^ 48), ch = getchar();
  return f ? -x : x;
}
const int N = 1 << 19, mod = 998244353;
int Pow(int x, int y) {
  int ans = 1;
  for (; y; y >>= 1, x = (long long)x * x % mod)
    if (y & 1) ans = (long long)ans * x % mod;
  return ans;
}
void Add(int &x, int y) {
  if ((x += y) >= mod) x -= mod;
}
void Del(int &x, int y) {
  if ((x -= y) < 0) x += mod;
}
int Add(int x) { return x >= mod ? x - mod : x; }
int Del(int x) { return x < 0 ? x + mod : x; }
namespace fft {
int w[N], R[N];
void init(int n) {
  int d = 0;
  while (1 << d < n) d++;
  for (int i = (0); i <= (n - 1); i++)
    R[i] = (R[i >> 1] >> 1) | ((i & 1) << (d - 1));
  w[0] = 1, w[1] = Pow(3, (mod - 1) / n);
  for (int i = (2); i <= (n - 1); i++) w[i] = (long long)w[i - 1] * w[1] % mod;
}
void FFT(int *a, int n, int flag) {
  for (int i = (0); i <= (n - 1); i++)
    if (i < R[i]) swap(a[i], a[R[i]]);
  for (int t = n >> 1, d = 1; d < n; d <<= 1, t >>= 1)
    for (int i = 0; i < n; i += d << 1)
      for (int j = 0; j < d; j++) {
        int tmp = (long long)w[t * j] * a[i + j + d] % mod;
        a[i + j + d] = Del(a[i + j] - tmp);
        Add(a[i + j], tmp);
      }
  if (flag < 0) {
    reverse(a + 1, a + n);
    int inv = Pow(n, mod - 2);
    for (int i = (0); i <= (n - 1); i++) a[i] = (long long)a[i] * inv % mod;
  }
}
vector<int> Mul(vector<int> a, vector<int> b) {
  int n = 1, m = max(0, (int)a.size() + (int)b.size() - 1);
  while (n < m) n <<= 1;
  a.resize(n), b.resize(n);
  init(n);
  FFT(&a[0], n, 1), FFT(&b[0], n, 1);
  for (int i = (0); i <= (n - 1); i++) a[i] = (long long)a[i] * b[i] % mod;
  FFT(&a[0], n, -1);
  a.resize(m);
  return a;
}
}  // namespace fft
vector<int> operator+(vector<int> a, vector<int> b) {
  int n = max(a.size(), b.size());
  a.resize(n), b.resize(n);
  for (int i = (0); i <= (n - 1); i++) Add(a[i], b[i]);
  return a;
}
vector<int> operator*(vector<int> a, vector<int> b) { return fft::Mul(a, b); }
int n;
int a[N];
int sqr(int x) { return (long long)x * x % mod; }
void R(vector<int> &a) { a.resize(n + 1); }
int main() {
  n = read();
  a[0] = 1, a[2] = 1;
  for (int i = (4); i <= (n); i++) a[i] = Add(a[i - 2] + a[i - 4]);
  int ans = 0;
  Add(ans, (long long)(a[n - 1] + a[n - 3]) * sqr(n - 1) % mod * n % mod);
  vector<int> f(n + 10), g(n + 10), h(n + 10);
  for (int i = (0); i <= (n); i++) {
    f[i + 1] = (long long)a[i] * sqr(i + 0) % mod;
    g[i + 2] = (long long)a[i] * sqr(i + 1) % mod;
    h[i + 3] = (long long)a[i] * sqr(i + 2) % mod;
  }
  R(f), R(g), R(h);
  vector<int> sf = f, sg = g, sh = h, F = f, G = g, H = h;
  for (int _ = (1); _ <= (16); _++) {
    vector<int> sf2 = sf + sg * g + sf * f;
    vector<int> sg2 = sg + sg * h + sf * g;
    vector<int> sh2 = sh + sg * g + sh * h;
    vector<int> f2 = f * f + g * g;
    vector<int> g2 = f * g + h * g;
    vector<int> h2 = h * h + g * g;
    swap(sf, sf2), swap(sg, sg2), swap(sh, sh2);
    swap(f, f2), swap(g, g2), swap(h, h2);
    R(f), R(g), R(h), R(sf), R(sg), R(sh);
  }
  for (int i = (0); i <= (n); i++) {
    Add(ans, (long long)F[i] * sf[n - i] % mod * i % mod);
    Add(ans, (long long)G[i] * sg[n - i] % mod * i % mod);
    Add(ans, (long long)G[i] * sg[n - i] % mod * i % mod);
    Add(ans, (long long)H[i] * sh[n - i] % mod * i % mod);
  }
  cout << ans << endl;
  return 0;
}
