Ursa Minor, also known as the Little Bear, is a constellation located in the far northern sky. There are seven stars in the Little Bear, with four of them in its bowl, like Big Dipper.
Polaris, the brightest one in the constellation, is also known as North Star.
You are given an undirected graph with stars and edges. It is guaranteed that the graph has no self-circle or multiple edges. The stars are numbered from to , and Polaris is the -th star.
Alice wants to count the number of Ursa Minors in this graph(pick out another six stars and form a subgraph just like the above picture). But that is too hard for her, so she adds a single constraint:
Specifically, she wants to find out how many tuples of six different stars such that:
the graph contains edges and .
the graph does not contain edges for all .
for all .
for all .
Since the answer may be large, print the answer modulo .
Input
第一行一個整數 ,表示數組組數。
對於每組數據:
第一行三個整數 ,分別表示星星的個數、邊數與勾陳一的編號。
接下來 行,其中每行兩個整數 ,表示圖中的一條邊。數據保證不存在重邊或自環。
The first line contains a single integer , denoting the number of test cases.
For each test case:
The first line contains three integers , denoting the number of stars, the number of edges and the index of Polaris respectively.
For the next lines, each line contains two integers , denoting an edge in the graph. It is guaranteed that and the graph has no self-circle or multiple edges.
Output
對於每組數據,輸出答案對 取模後的結果。
For each test case, print a single integer denoting the answer modulo .