#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
  #include "settings/debug.cpp"
  #define _GLIBCXX_DEBUG
#else
  #define Debug(...) void(0)
#endif
#define rep(i, n) for (int i = 0; i < (n); ++i)
using ll = long long;
using ull = unsigned long long;

#include <atcoder/modint>
using mint = atcoder::modint998244353;

int main() {
  constexpr int sz = 2e5;
  vector<mint> r(sz), e(sz);
  r[0] = 1, e[0] = 1;
  r[1] = 1, e[1] = 3;
  rep(i, sz) {
    if (i < 2) continue;
    r[i] = r[i - 1] + r[i - 2];
    e[i] = e[i - 1] + e[i - 2];
  }
  int q;
  cin >> q;
  while (q--) {
    int n;
    cin >> n;
    --n;
    cout << (5 * r[n] * r[n] - e[n] * e[n]).val() << endl;
  }
  return 0;
}