AT_abc405_e [ABC405E] Fruit Lineup

Description

You have $ A $ apples, $ B $ oranges, $ C $ bananas, and $ D $ grapes. How many ways are there to arrange these $ A+B+C+D $ fruits in a single row from left to right so that all of the following conditions hold? Find the count modulo $ 998244353 $ . - Every apple is placed to the left of every banana. - Every apple is placed to the left of every grape. - Every orange is placed to the left of every grape. Here, the apples are indistinguishable; the same goes for the oranges, the bananas, and the grapes.

Input Format

The input is given from Standard Input in the following format: > $ A $ $ B $ $ C $ $ D $

Output Format

Output the number, modulo $ 998244353 $ , of valid arrangements.

Explanation/Hint

### Sample Explanation 1 There are five valid arrangements: - apple, orange, banana, grape - apple, orange, grape, banana - apple, banana, orange, grape - orange, apple, banana, grape - orange, apple, grape, banana ### Constraints - $ 1 \le A \le 10^6 $ - $ 1 \le B \le 10^6 $ - $ 1 \le C \le 10^6 $ - $ 1 \le D \le 10^6 $ - $ A $ , $ B $ , $ C $ , and $ D $ are integers.