401522: GYM100488 I Map Coloring

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

I. Map Coloringtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

Peter Godunov is ordered to make the map of Syberia. Syberia consists of n regions, some of which eccentrically border on each other. He wants to assign each of them some color but he has only k different paints. Moreover, according to the terms of reference, on the final version of the map two regions must have different color if and only if they are neighbour regions. It's not required to use all the paints. Help Peter to handle the task or he will be beheaded.

Input

The first line contains three integers separated by spaces: n, m and k (1 ≤ n ≤ 1000, , 1 ≤ k ≤ n) — the number of regions in Syberia, the number of pairs of neighbour regions and the number of paints Peter has.

The next m lines contain two integers each: xj and yj (1 ≤ xj, yj ≤ n, xj ≠ yj) — the numbers of the neighbour regions. Each pair of regions occures at most once.

Output

Output n integers ci separated by spaces (1 ≤ ci ≤ k), where ci is a color to paint the i-th region. If it will cost Peter his head, output the only number « - 1».

ExamplesInput
3 2 2
1 2
2 3
Output
1 2 1
Input
4 4 2
1 2
2 3
3 4
4 1
Output
1 2 1 2
Input
4 4 3
1 2
1 3
1 4
2 3
Output
-1

加入题单

算法标签: