#include using namespace std; #define pb push_back using ll = long long; using vi = vector ; const ll mod = 998244353; const int N = 12e4 + 11; ll inv[N], fac[N], ifac[N]; ll binom(int n, int m) { if(n < m || m < 0) return 0; // n >= 0 return fac[n] * ifac[m] % mod * ifac[n - m] % mod; } ll qpow(ll a, ll b) { ll r = 1, t = a; for(; b; b /= 2) { if(b & 1) r = r * t % mod; t = t * t % mod; } return r; } using vl = vector ; ll f[N]; const ll P = mod, G = 3; ll INV(ll x) { return qpow(x, P - 2); } void ntt(vl &a, int op = 1) { // P: 模数, G: 原根 int n = a.size(); for (int i = 1, j = 0; i < n - 1; ++i) { for (int s = n; j ^= s >>= 1, ~j & s;) {} if (i < j) swap(a[i], a[j]); } for (int i = 1; i < n; i *= 2) { ll u = qpow(G, (P - 1) / (i * 2)); if (op == -1) u = INV(u); for (int j = 0; j < n; j += i * 2) { ll w = 1; for (int k = 0; k < i; ++k, w = w * u % P) { int x = a[j + k], y = w * a[j + k + i] % P; #define modto(x) ({if ((x) >= P) (x) -= P;}) a[j + k] = x + y; modto(a[j + k]); a[j + k + i] = x - y + P; modto(a[j + k + i]); #undef modto }}} if (op == -1) { ll inv = INV(n); for (int i = 0; i < n; ++i) a[i] = a[i] * inv % P; } } vl multi(vl a, vl b) { int m = a.size() + b.size() - 1; int n = 1; while (n < m) n *= 2; vl fa(n), fb(n), fc(n); copy(a.begin(), a.end(), fa.begin()); ntt(fa); copy(b.begin(), b.end(), fb.begin()); ntt(fb); for (int i = 0; i < n; ++i) fc[i] = fa[i] * fb[i] % P; ntt(fc, -1); fc.resize(m); return fc; } int main() { inv[1] = fac[0] = ifac[0] = 1; for(int i = 2; i < N; i ++) inv[i] = (mod - mod / i) * inv[mod % i] % mod; for(int i = 1; i < N; i ++) { fac[i] = i * fac[i - 1] % mod; ifac[i] = inv[i] * ifac[i - 1] % mod; } ios::sync_with_stdio(0); int n; ll b, c; cin >> n >> b >> c; f[0] = 1; while(b > 0) { vl F(f, f + n + 1); vl G(n + 1); for(int i = 0; i <= n; i ++) if(i % 2 == c % 2) G[i] = binom(n, i); //~ for(int i = 0; i <= n; i ++) cout << F[i] << ' '; cout << '\n'; //~ for(int i = 0; i <= n; i ++) cout << G[i] << ' '; cout << '\n'; G = multi(F, G); //~ for(int i = 0; i < G.size(); i ++) cout << G[i] << ' '; cout << '\n'; G.resize(2 * n + 2); for(int i = 0; i <= n; i ++) f[i] = G[i * 2 + (b & 1)]; b /= 2; c /= 2; } cout << f[0] << '\n'; }