On one side of the chessboard is the rising star of the chess world, Mas, and on the other is the veteran warrior who has dominated the battlefield, Z...
The winds are rising, sand and stones are flying...
Who will win this decisive battle?
As the commentator, you watch the two people in front of you sitting motionless for a long, long time, and then you fall asleep...
Upon waking up, you find that the two have finished their match, and even the pieces on the board have been cleared away.
This is truly an indelible stain on your commentary career: the match ended before you even started commentating!
To save your reputation, you decide to calculate how many different final board states there are.
This game is different from ordinary board games; it is as follows:
The board is a labeled undirected graph with $n$ vertices and $m$ edges, containing no multiple edges or self-loops.
Before the game begins, there is a number $k$, representing the number of different colors of pieces available.
Initially, there are no pieces on any of the nodes.
The two players take turns (with Mas going first). The current player takes a new piece of a certain color and places it on an empty node in the graph, such that for all adjacent nodes $x$, either $x$ has no piece, or the piece on $x$ has a different color than the piece chosen by the current player.
Note that pieces cannot be moved.
The player who cannot make a move loses the game.
As the commentator, you know that the skills of Mas and Z are unfathomable, so you know that in their final board state, there is not a single node without a piece.
Guessing who will win cannot demonstrate your level of expertise, so you will calculate the number of different final board states.
Two states are different if and only if there exists a node where the color of the piece placed on that node is different between the two states.
Furthermore, since you took a nap, you have even forgotten the number $k$. Therefore, you will calculate a polynomial $F(x)$ such that for any $k$, substituting $k$ into the polynomial yields the result $F(k)$, which is the number of different final board states with $k$ colors (it can be proven that such a polynomial exists).
Since the coefficients of the polynomial can be very large, please output the coefficients of the polynomial modulo $10^9+7$.
Note: This is an answer-submission problem. There are 10 test cases in total, each worth 10 points. Each test case contains an input file, and each input file contains five sets of test data, with each set worth 2 points. It is guaranteed that the five sets of test data within the same test case share related data characteristics, and the data has a certain gradient.
Input
There are 10 test cases in total, numbered $1 \sim 10$.
Each test case has an input file. The input file for the test case numbered * is game*.in, and each file contains five sets of test data.
For a set of test data:
The first line contains two integers $n$ and $m$, representing the number of vertices and edges of the board.
The next $m$ lines each contain two integers $u, v (u \neq v)$, representing an undirected edge in the graph. It is guaranteed that there are no self-loops or multiple edges.
For the convenience of participants, there is an empty line between two adjacent sets of test data.
Output
For the test case numbered *, the participant must submit an answer file named game*.out.
For each test case, the participant must output five lines in the answer file.
For each set of test data, please output a single line containing $n+1$ numbers $f_0, f_1, \dots, f_n$, separated by spaces, representing the polynomial $F(x) = \sum_{i=0}^n f_i \cdot x^i$.
If for a certain set of test data, the participant has not found the answer, please be sure to output exactly $n+1$ integers in the range $[0, 10^9+7)$ (it is recommended to output 0); otherwise, the score for this test case will be considered 0.
Examples
Input 1
1 0
2 0
3 0
3 2
1 2
1 3
3 3
1 2
1 3
2 3
Output 1
0 1
0 0 1
0 0 0 1
0 1 1000000005 1
0 2 1000000004 1
Scoring
Each test case is scored individually using a special judge.
For a test case, scoring is performed in the order of the test data.
There is a counter $s$ initialized to 0.
For the $i$-th set of test data, let $n_i$ be the number of vertices given in this set. The participant's file should contain exactly $5 + \sum_{i=1}^5 n_i$ numbers. If there are more or fewer than $5 + \sum_{i=1}^5 n_i$ numbers, the output format is invalid, and the score for this test case is 0.
Scoring proceeds in the order $i=1 \dots 5$. For the $i$-th set of test data, the judge reads $n_i+1$ numbers from the participant's file and compares them with the answer. If they are identical, $s$ is increased by 2.
If the output format is valid, the score for the test case is $s$; otherwise, the score is 0.
If the participant's file contains characters other than numbers, spaces, or line breaks, unpredictable results may occur, and the consequences are the responsibility of the participant.
Note
It is guaranteed that the given graph is an undirected graph with no multiple edges or self-loops.
Participants should carefully read the scoring method and output format to avoid unnecessary mistakes.
It is guaranteed that the five sets of test data within the same test case share related data characteristics, and these five sets have a certain gradient.
Data Characteristics of Partial Test Cases
- For test case 2, the given graph is a tree.
- For test case 3, the given graph is a cactus graph.
- For test case 4, each biconnected component in the given graph has no more than 15 vertices ("biconnected component" is defined as a maximal subgraph with no articulation points).
- For test case 8, the complement of the given graph is a tree.