For the two multisets

and

, In an operation, we can choose one between the following two operations:
1. Update an element

in the multiset

, to
2. Update an element

in the multiset

, to
We define
)
as the minimum number of operations to make the multisets

and

identical,meaning that both multisets have the same elements, If there is no way to transform multisets

and

into the same multiset, then
%3D0)
.
Now you have two multisets

and

, and calc the value of
)
modulo

.
Note: Subsets in the multiset are allowed to duplicate values, that is, the number of solutions selected from each of the two sets

and

is
(2%5E%7B%7CT%7C%7D-1))
.
输入描述:
The first line contains a positive integer
,representing the size of the multiset
and the multiset
.
The second line contains a line of
positive integers
, representing the multiset
.
The third line contains a line of

positive integers
)
, representing the multiset

.
The input sequence is not guaranteed to be ordered.
输出描述:
Output a line with a integer representing the answer, modulo
.
示例1
说明
A={2} B={1} C(A,B)=1
A={2} B={1} C(A,B)=1
A={1 2} B={1 1} C(A,B)=1