#include #include using namespace std; using namespace atcoder; struct Fast { Fast() { std::cin.tie(nullptr); ios::sync_with_stdio(false); cout << setprecision(10); } } fast; #define all(a) (a).begin(), (a).end() #define contains(a, x) ((a).find(x) != (a).end()) #define rep(i, a, b) for (int i = (a); i < (int)(b); i++) #define rrep(i, a, b) for (int i = (int)(b)-1; i >= (a); i--) #define writejoin(s, a) rep(_i, 0, (a).size()) cout << (a)[_i] << (_i + 1 < (int)(a).size() ? s : "\n"); #define YN(b) cout << ((b) ? "YES" : "NO") << "\n"; #define Yn(b) cout << ((b) ? "Yes" : "No") << "\n"; #define yn(b) cout << ((b) ? "yes" : "no") << "\n"; using ll = long long; using vi = vector; using vvi = vector; using vl = vector; using mint = modint998244353; using vm = vector; template class Factorial { public: Factorial(int max) : n(max) { f = vector(n + 1); finv = vector(n + 1); f[0] = 1; for (int i = 1; i <= n; i++) f[i] = f[i - 1] * i; finv[n] = f[n].inv(); for (int i = n; i > 0; i--) finv[i - 1] = finv[i] * i; } mint fact(int k) { assert(0 <= k && k <= n); return f[k]; } mint fact_inv(int k) { assert(0 <= k && k <= n); return finv[k]; } mint binom(int k, int r) { assert(0 <= k && k <= n); if (r < 0 || r > k) return 0; return f[k] * finv[r] * finv[k - r]; } mint inv(int k) { assert(0 < k && k <= n); return finv[k] * f[k - 1]; } private: int n; vector f, finv; }; int main() { const int LOG = 60; int n; ll b, c; cin >> n >> b >> c; Factorial fact(n); vm dp(n + 1, 0); dp[0] = 1; rrep(k, 0, LOG) { int bd = (int)((b >> k) & 1); int cd = (int)((c >> k) & 1); vm f(n + 1, 0), g(n + 1, 0); for (int i = (bd ^ cd) + cd; i <= n; i += 2) f[i] = dp[i / 2]; for (int j = cd; j <= n; j += 2) g[n - j] = fact.binom(n, j); auto h = convolution(f, g); dp = vm(n + 1, 0); for (int i = bd ^ cd; i <= n; i += 2) dp[i] = h[n + i]; } cout << dp[0].val() << endl; }