Accidentally, Cupid, god of desire has hurt himself with his own dart and fallen in love with Psyche.
This has drawn the fury of his mother, Venus. The goddess then throws before Psyche a great mass of mixed crops.
There are $ n $ heaps of crops in total, numbered from $ 1 $ to $ n $.
Psyche needs to arrange them in a certain order, assume crops on the $ i $-th position is $ A_i $.
She is given some information about the final order of the crops:
1. the minimum value of $ A_1, A_2, ..., A_i $ is $ B_i $.
2. the maximum value of $ A_1, A_2, ..., A_i $ is $ C_i $.
She wants to know the number of valid permutations. As this number can be large, output it modulo $ 998244353 $.
Note that if there is no valid permutation, the answer is $ 0 $.