using System;
using System.Text;
using System.Diagnostics;
using System.Numerics;
using System.Collections.Generic;

class Myon

{
    public Myon() { }
    public static int Main()
    {
        cin = new Scanner();
        new Myon().calc();
        return 0;
    }
    static Scanner cin;

    int A, B, C, D;

    void calc()
    {
        A = cin.nextInt();
        B = cin.nextInt();
        C = cin.nextInt();
        D = cin.nextInt();

        dp = new long[C + 1, D + 1, 3];
        for (int i = 0; i < C + 1; i++)
        {
            for (int j = 0; j < D + 1; j++)
            {
                for (int k = 0; k < 3; k++)
                {
                    dp[i, j, k] = -1;
                }
            }
        }
        Console.WriteLine(dfs(C, D, 0));
    }

    long mod = 998244353;


    long[,,] dp;

    long dfs(int a, int b, int type)
    {
        if (dp[a, b, type] >= 0) return dp[a, b, type];
        if (a == A && b == B) return 1;
        else if(a == A)
        {
            if (type != 0) return 0;
            return dp[a, b, type] = dfs(a, b - 1, 0) * a % mod;
        }
        else if(b == B)
        {
            if (type != 0) return 0;
            return dp[a, b, type] = dfs(a - 1, b, 0) * b % mod;
        }
        else
        {
            if(type == 0)
            {
                long ans = dfs(a - 1, b - 1, 0) * (a - 1) % mod * (b - 1) % mod;
                ans += dfs(a - 1, b, 0);
                ans += dfs(a, b - 1, 0);
                ans += dfs(a - 1, b, 1) * (b - 1);
                ans += dfs(a, b - 1, 2) * (a - 1);
                ans %= mod;
                return dp[a, b, type] = ans;
            }
            else if(type == 1)
            {
                long ans = dfs(a - 1, b, 1) * (b - 1);
                ans += dfs(a - 1, b, 0);
                ans %= mod;
                return dp[a, b, type] = ans;
            }
            else
            {
                long ans = dfs(a, b - 1, 2) * (a - 1);
                ans += dfs(a, b - 1, 0);
                ans %= mod;
                return dp[a, b, type] = ans;
            }
        }
    }

    int gcd(int a, int b)
    {
        if (b == 0) return a;
        return gcd(b, a % b);
    }

}


class Scanner
{
    string[] s;
    int i;

    char[] cs = new char[] { ' ' };

    public Scanner()
    {
        s = new string[0];
        i = 0;
    }

    public string next()
    {
        if (i < s.Length) return s[i++];
        string st = Console.ReadLine();
        while (st == "") st = Console.ReadLine();
        s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        if (s.Length == 0) return next();
        i = 0;
        return s[i++];
    }

    public int nextInt()
    {
        return int.Parse(next());
    }
    public int[] ArrayInt(int N, int add = 0)
    {
        int[] Array = new int[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextInt() + add;
        }
        return Array;
    }

    public long nextLong()
    {
        return long.Parse(next());
    }

    public long[] ArrayLong(int N, long add = 0)
    {
        long[] Array = new long[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextLong() + add;
        }
        return Array;
    }

    public double nextDouble()
    {
        return double.Parse(next());
    }


    public double[] ArrayDouble(int N, double add = 0)
    {
        double[] Array = new double[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextDouble() + add;
        }
        return Array;
    }
}

Measured memory_bytes: 238808