The input consists of descriptions of the two graphsand
sequentially.
For each graph, the first line contains two integers![]()
, denoting the number of vertices and edges in the graph, followed by
lines, with each line containing two integers
![]()
, denoting an edge in the graph.
It is guaranteed that both graphs are connected, and have no self-loop or multiple edges.
Output an integer in a line, denoting the number of ways to deleteedges to disconnect the graph
, taken modulo
.