The first line contains an integer $T (1 \le T \le 30000)$ - the number of test cases. Then $T$ test cases follow.
The first line of each test case contains two integers $n, m (1\le n,m \le 10^6)$ - the number of vertices and edges.
Then $m$ lines follow, each line contains two integers $u_i,v_i(1 \leq u_i, v_i \leq n, u_i \not= v_i)$ representing an edge. It is guaranteed that there are no multiple edges in the input, and the graph $\pmb{\text{may}}$ be unconnected.
Then numbers and colors of the two graphs follow. For each graph:
The first line contains $n$ integers, the $i$-th integer $a_i (0 \le a_i \le 10^6)$ representing the number of the $i$-th node of the graph.
The second line contains $n$ characters. If the $i$-th character is `R', the $i$-th node is red. If the $i$-th character is `B', the $i$-th node is black.
It is guaranteed that $\sum n \le 10^6, \sum m \le 10^6$.