// #pragma GCC target("avx2") #pragma GCC optimize("O3") // #pragma GCC optimize("unroll-loops") #include #include #include using namespace std; using P = pair; using mint = atcoder::modint998244353; int main() { cin.tie(0); ios::sync_with_stdio(0); int n; long long b, c; cin >> n >> b >> c; vector binom(n + 1); binom[0] = 1; for (int i = 0; i < n; ++i) { binom[i + 1] = binom[i] * (n - i) / (i + 1); } vector> rbn2(2); for (int i = 0; i < (int)binom.size(); ++i) { rbn2[i % 2].push_back(binom[i]); } // reverse(rbn2[0].begin(), rbn2[0].end()); // reverse(rbn2[1].begin(), rbn2[1].end()); vector dp(1); dp[0] = 1; for (int k = 0; k < 62; ++k) { vector> dp2(2); for (int i = 0; i < (int)dp.size(); ++i) { dp2[i % 2].push_back(dp[i]); } int bk = (b >> k) & 1; int ck = (c >> k) & 1; dp = atcoder::convolution(dp2[bk ^ ck], rbn2[ck]); if (bk == 0 && ck == 1) { dp.insert(dp.begin(), mint(0)); } } if (dp.empty()) { cout << 0 << '\n'; } else { cout << dp[0].val() << '\n'; } return 0; }