Let the value of a connected undirected graph be the length of the shortest path from
Constraints
Subtask 1 [30%]
Subtask 2 [20%]
Subtask 3 [30%]
Subtask 4 [20%]
No additional constraints.
Input Specification
The first and only line contains
Output Specification
On a single line, output the desired values modulo
Sample Input 1
Copy
3 3 100000007
Sample Output 1
Copy
4 1
Explanation for Sample 1
There are three graphs with
Sample Input 2
Copy
4 6 100000007
Sample Output 2
Copy
26 20 7 1
Comments