#### 代码
```cpp
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int mod = 998244353;
int n, m, a, b, x, y, yyc, lby, _yyc, _lby, ans, cnt;
inline int qstp(int a, int k) {int res = 1; for(; k; a = a * a % mod, k >>= 1) if(k & 1) res = res * a % mod; return res;}
signed main(){
cin >> n >> m >> a >> b >> x >> y;
yyc = min(a, x) - 1, lby = max(a, x);
_yyc = min(b, y) - 1, _lby = max(b, y);
cnt = lby - yyc + _lby - _yyc - 2;
for(int i = 1; i <= yyc; ++i) ans = (ans + qstp(yyc - i + 1 + cnt, mod - 2)) % mod;
for(int i = lby; i < n; ++i) ans = (ans + qstp(i - lby + 1 + cnt, mod - 2)) % mod;
for(int i = 1; i <= _yyc; ++i) ans = (ans + qstp(_yyc - i + 1 + cnt, mod - 2)) % mod;
for(int i = _lby; i < m; ++i) ans = (ans + qstp(i - _lby + 1 + cnt, mod - 2)) % mod;
cout << (ans + 1) % mod;
return 0;
}
```