#include"bits/stdc++.h" #include"atcoder/all" usingnamespace std; #define fi first #define se second #define vi vector<int> #define pb push_back #define eb emplace_back #define pii pair<int,int> #define mp make_pair #define rep( i , a , b ) for( int i = (a) , i##end = b ; i <= i##end ; ++ i ) #define per( i , a , b ) for( int i = (a) , i##end = b ; i >= i##end ; -- i ) #define mem( a ) memset( a , 0 , sizeof (a) ) #define all( x ) x.begin() , x.end() //#define int long long // #pragma GCC optimize(2) typedeflonglong ll; constint MAXN = 2e6 + 10; constint P = 998244353; int ab , bc , cd , da; int a , b , c , d;
intPow( int x , int a ){ int ret = 1; while( a ) { if( a & 1 ) ret = ret * 1ll * x % P; x = x * 1ll * x % P , a >>= 1; } return ret; }
voidInc( int&a , int b ){ a = ( a + b < P ? a + b : a + b - P ); }
int J[MAXN] , iJ[MAXN]; intC( int a , int b ){ if( a < b || b < 0 || a < 0 ) return0; return J[a] * 1ll * iJ[b] % P * iJ[a - b] % P; }
intgiJ( int x , int coef = 0 ){ return x < 0 ? coef : iJ[x]; } intgJ( int x ){ return x < 0 ? 0 : J[x]; }
voidsolve(){ J[0] = 1; rep( i , 1 , 2000000 ) J[i] = J[i - 1] * 1ll * i % P; iJ[2000000] = Pow( J[2000000] , P - 2 ); per( i , 2000000 , 1 ) iJ[i - 1] = iJ[i] * 1ll * i % P; cin >> ab >> bc >> cd >> da; if( ( ab + da & 1 ) || ( bc + ab & 1 ) || ( bc + cd & 1 ) || ( cd + da & 1 ) ) { puts("0"); return; } // cout << C( ab + cd , ab ) * 1ll * C( bc + da , bc ) % P << endl; a = ( ab + da >> 1 ) , b = ( ab + bc >> 1 ) , c = ( bc + cd >> 1 ) , d = ( cd + da >> 1 ); int s = a + 1 , x = ab;
vector<int> A( s ) , B( s ); rep( k , 0 , s - 1 ) A[k] = J[s - 1 - k] * 1ll * giJ( x - 2 * k ) % P * giJ( b + k - x ) % P * iJ[k] % P * iJ[s - 1 - k] % P; rep( t , 0 , s - 1 ) B[t] = iJ[t] * 1ll * giJ( 2 * s - 2 - 2 * t - x ) % P * giJ( d - 2 * s + t + 2 + x ) % P; vi re = atcoder::convolution( A , B ); int ans = 0; rep( p , 0 , s - 1 ) { int tr = re[p] * 1ll * iJ[s - 1 - p] % P * J[2 * s - 2 - 2 * p] % P * gJ( b + d - s ) % P * giJ( s - 2 - p ) % P * giJ( b + d - 2 * s + 2 + p ) % P * gJ( b + d - 2 * s + p + 2 ) % P * J[s - 1] % P; ans = ( ans + tr ) % P; } cout << ans << endl; }