You want to place k people in a place shaped like a graph. The graph has n vertices and m edges.
The score of an arrangement is based on the following two factors:
Your task is to print an arrangement with as high a score as possible. Note that you can drop a person and don't give him a vertice in the graph.
Input format
Output format
Print k integers. The ith number is the number of the vertex you assigned to the ith person. Otherwise, print 0 if you do not want to include this person in the arrangement.
Constraints
n=m=2000001≤k≤100001≤di,fi≤1000
Note that this isn't necessarily the best arrangement. We assign the second vertex to the first person, the third vertex to the second person, and the first vertex to the fourth person. Also, we drop the third person. As the first vertex (where the fourth person is) is connected to the third vertex (where the second person is), they form a connected component and increase the score by (2+4)^2. The first person forms a single-member connected component and adds (1)^2 to the answer too. On the other hand, the second and the fourth person decrease the answer by 6*8. The overall score is 36+1-48=-11.