For the two multisets AAA and BBB , In an operation, we can choose one between the following two operations:
1. Update an element aia_iai in the multiset AAA, to ai=ai+1a_i=a_i+1ai=ai+1
2. Update an element bib_ibi in the multiset BBB, to bi=bi+1b_i=b_i+1bi=bi+1
We define C(A,B)C(A,B)C(A,B) as the minimum number of operations to make the multisets AAA and BBB identical,meaning that both multisets have the same elements, If there is no way to transform multisets AAA and BBB into the same multiset, then C(A,B)=0C(A,B)=0C(A,B)=0.
Now you have two multisets SSS and TTT, and calc the value of ∑A⊆S∑B⊆TC(A,B)\sum\limits_{A\subseteq S}\sum\limits_{B\subseteq T}C(A,B)A⊆S∑B⊆T∑C(A,B) modulo 998244353998244353998244353.
Note: Subsets in the multiset are allowed to duplicate values, that is, the number of solutions selected from each of the two sets SSS and TTT is (2∣S∣−1)(2∣T∣−1)(2^{|S|}-1)(2^{|T|}-1)(2∣S∣−1)(2∣T∣−1).