#include <bits/stdc++.h>
using namespace std;
const int N = 5005, mod = 998244353;
namespace {
inline int add(int x, int y) { return x + y >= mod ? x + y - mod : x + y; }
inline void Add(int &x, int y) { x = add(x, y); }
inline int mnu(int x, int y) { return x - y < 0 ? x - y + mod : x - y; }
inline int mul(int x, int y) { return (long long)x * y % mod; }
inline int power(int x, long long p) {
  int res = 1;
  for (; p; p >>= 1, x = (long long)x * x % mod)
    if (p & 1) res = (long long)res * x % mod;
  return res;
}
}  // namespace
namespace LS {
int p[N], d[N], m;
vector<int> s[N];
vector<int> BM(vector<int> a) {
  int n = a.size();
  for (; m;) s[m--].clear();
  for (int i = (0); i < (n); i++) {
    d[i] = a[i];
    for (int j = (0); j < (s[m].size()); j++)
      d[i] = mnu(d[i], mul(a[i - j - 1], s[m][j]));
    if (!d[i]) continue;
    p[m] = i;
    if (!m) {
      s[++m].resize(i + 1);
      continue;
    }
    int id = m - 1;
    for (int j = (0); j < (m - 1); j++)
      id = (p[j] - s[j].size() > p[id] - s[id].size() ? j : id);
    int coef = mul(d[i], power(d[p[id]], mod - 2));
    s[++m].resize(i - p[id] - 1);
    s[m].push_back(coef);
    for (int j = (0); j < (s[id].size()); j++)
      s[m].push_back(mul(mod - coef, s[id][j]));
    for (int j = (0); j < (s[m - 1].size()); j++)
      if (j < s[m].size())
        s[m][j] = add(s[m][j], s[m - 1][j]);
      else
        s[m].push_back(s[m - 1][j]);
  }
  return s[m];
}
const long long Mod = (long long)mod * mod * 8;
int A[N], B[N], bin[N], res[N], n;
inline void Mul(int *x, int *y) {
  static long long t[N << 1];
  for (int k = (0); k <= (n * 2 - 2); k++) t[k] = 0;
  for (int i = (0); i < (n); i++)
    for (int j = (0); j < (n); j++)
      t[i + j] += (long long)x[i] * y[j],
          (t[i + j] >= Mod ? t[i + j] -= Mod : 0);
  ;
  for (int i = (n * 2 - 2); i >= (n); i--) {
    t[i] %= mod;
    for (int j = (0); j < (n); j++)
      t[i - j - 1] += t[i] * A[j],
          (t[i - j - 1] >= Mod ? t[i - j - 1] -= Mod : 0);
    ;
    t[i] = 0;
  }
  for (int i = (0); i < (n); i++) x[i] = t[i] % mod;
}
int solve(vector<int> a, vector<int> b, long long K) {
  n = a.size();
  if (K <= n - 1) return b[K];
  if (n == 1) return mul(b[0], power(a[0], K));
  for (int i = (0); i < (n); i++) {
    bin[i] = res[i] = 0;
    A[i] = a[i], B[i] = b[i];
  }
  bin[1] = res[0] = 1;
  for (K -= n - 1; K; K >>= 1, Mul(bin, bin))
    if (K & 1) Mul(res, bin);
  for (int i = (n); i <= (n * 2 - 2); i++) {
    B[i] = 0;
    for (int j = (0); j < (n); j++) B[i] = add(B[i], mul(B[i - j - 1], A[j]));
  }
  int s = 0;
  for (int i = (0); i < (n); i++) s = add(s, mul(B[n - 1 + i], res[i]));
  return s;
}
int gao(vector<int> x, long long K) { return solve(BM(x), x, K); }
}  // namespace LS
int main() {
  int n;
  while (cin >> n) {
    cout << LS::gao({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, 886871858, 80677633,
                     874800287, 754269413, 659807497, 302870971, 307001715},
                    n - 1)
         << endl;
  }
  return 0;
}
