P27431 [AtCoder] This Year's B Problem
普及+
题目描述

Problem Description

A graph satisfying the constraints of This Year's A Problem is given.

Color this graph with 4 colors such that no adjacent vertices have the same color.

Input Format

The input is given from the standard input in the following format:

$ V $ $ E $ $ a_1 $ $ b_1 $ $ a_2 $ $ b_2 $ : $ a_E $ $ b_E $

Output Format

The output consists of $ V $ lines. On the $ i $-th line, output the color $ c_i $ ( $1 \leq c_i \leq 4$ ) of vertex $ i $.

Sample Input and Output

Sample Input #1

4 4
1 2
2 3
3 4
4 1

Sample Output #1

1
2
3
4

Sample Input #2

5 3
1 2
2 3
3 4

Sample Output #2

1
2
3
4
1

Notes/Hints

Constraints

  • Refer to This Year's A Problem
  • However, during the contest time, an AC will be given for correct answers to inputs with $1 \leq V \leq 10$

Scoring

The score for this problem is determined after the contest ends with the following procedure:

During the contest time, the last submission of each finalist that was accepted for Problem A is considered their official submission for Problem A.

During the contest time, your last submission that was accepted for Problem B is considered your official submission for Problem B.

Submitting your official submission for Problem B awards you 200 points.

After the contest ends, the input part (lines 1 to $ E+1 $) of each finalist's official submission for Problem A is given as input to your official submission for Problem B.

If your official submission for Problem B correctly answers the input parts of $ n $ other finalists' official submissions for Problem A, and there were $ m $ other finalists who did not have an official submission for Problem A, you are awarded an additional $ 10(n+m) $ points.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
4 4 1 2 2 3 3 4 4 1
样例输出
1 2 3 4