Andryusha goes through a park each day. The squares and paths between them look boring to Andryusha, so he decided to decorate them.

The park consists of *n* squares connected with (*n* - 1) bidirectional paths in such a way that any square is reachable from any other using these paths. Andryusha decided to hang a colored balloon at each of the squares. The baloons' colors are described by positive integers, starting from 1. In order to make the park varicolored, Andryusha wants to choose the colors in a special way. More precisely, he wants to use such colors that if *a*, *b* and *c* are distinct squares that *a* and *b* have a direct path between them, and *b* and *c* have a direct path between them, then balloon colors on these three squares are distinct.

Andryusha wants to use as little different colors as possible. Help him to choose the colors!
The first line contains single integer *n* (3 ≤ *n* ≤ 2·10<sup class="upper-index">5</sup>) — the number of squares in the park.

Each of the next (*n* - 1) lines contains two integers *x* and *y* (1 ≤ *x*, *y* ≤ *n*) — the indices of two squares directly connected by a path.

It is guaranteed that any square is reachable from any other using the paths.
In the first sample the park consists of three squares: 1 → 3 → 2. Thus, the balloon colors have to be distinct.

In the second example there are following triples of consequently connected squares: 
 -  1 → 3 → 2 -  1 → 3 → 4 -  1 → 3 → 5 -  2 → 3 → 4 -  2 → 3 → 5 -  4 → 3 → 5 
In the third example there are following triples: 
 -  1 → 2 → 3 -  2 → 3 → 4 -  3 → 4 → 5
3
2 3
1 3
3
1 3 2 
5
2 3
5 3
4 3
1 3
5
1 3 2 5 4 
5
2 1
3 2
4 3
5 4
3
1 2 3 1 2 
10
5 3
9 2
7 1
3 8
4 1
1 9
10 1
8 9
6 2
5
1 2 1 3 2 1 2 3 4 5 
3
2 1
3 2
3
1 2 3 
10
2 7
8 2
9 8
1 9
4 1
3 4
6 3
10 6
5 10
3
1 1 2 3 2 1 2 3 2 3 
5
4 2
3 1
3 4
3 5
4
1 1 2 3 4 
7
3 6
3 1
3 2
3 5
3 4
3 7
7
1 4 2 6 5 3 7 
10
8 6
10 5
8 4
2 7
3 8
10 3
3 9
2 1
3 2
5
1 2 4 3 1 2 3 1 5 3 
50
45 2
4 48
16 4
17 29
29 33
31 2
47 41
41 33
22 6
44 40
32 24
12 40
28 16
18 30
20 41
25 45
35 29
10 32
1 48
15 50
6 9
43 2
33 2
38 33
8 2
36 7
26 48
50 8
34 31
48 33
13 45
37 33
7 6
40 32
3 6
30 49
49 33
11 40
19 40
24 2
14 50
5 50
42 16
23 2
9 45
39 6
46 48
27 13
21 2
9
1 4 4 3 4 2 3 6 5 2 5 4 3 3 2 1 2 2 6 2 9 1 8 7 2 4 2 2 1 1 2 1 5 1 3 1 7 6 6 3 3 4 3 2 1 6 1 2 8 1 
50
8 37
40 8
38 40
10 38
29 10
33 29
17 33
25 17
19 25
3 19
13 3
24 13
12 24
5 12
41 5
11 41
27 11
45 27
6 45
35 6
9 35
50 9
32 50
21 32
22 21
1 22
31 1
28 31
4 28
30 4
7 30
48 7
46 48
16 46
49 16
39 49
18 39
14 18
34 14
23 34
20 23
15 20
44 15
42 44
2 42
36 2
43 36
26 43
47 26
3
1 3 2 1 1 2 2 2 3 2 2 2 1 1 3 2 2 2 3 1 3 2 2 3 1 3 1 2 1 3 3 1 3 3 1 2 3 3 3 1 3 1 1 2 3 3 2 1 1 2 
50
7 5
6 40
49 43
48 2
44 11
10 3
46 49
22 18
17 33
4 29
48 4
47 41
24 19
48 8
1 21
2 17
17 34
16 10
17 20
1 22
44 32
6 28
7 1
47 26
28 44
23 50
21 15
1 30
7 27
28 25
17 23
14 42
6 46
5 24
44 9
25 39
46 47
21 35
7 16
34 12
45 14
35 36
28 13
6 48
46 37
39 45
40 7
2 31
30 38
6
1 2 2 3 2 1 4 5 5 1 1 2 5 3 3 5 1 2 3 5 2 3 6 1 4 2 3 2 1 5 3 4 3 4 4 1 5 2 1 6 1 1 1 3 2 3 4 4 2 2 
import sys
from collections import defaultdict
from  collections import deque
from types import GeneratorType
input = sys.stdin.readline

def bootstrap(f, stack=[]):
    
    def wrappedfunc(*args, **kwargs):
        if stack:
            return f(*args, **kwargs)
        else:
            to = f(*args, **kwargs)
            while True:
                if type(to) is GeneratorType:
                    stack.append(to)
                    to = next(to)
                else:
                    stack.pop()
                    if not stack:
                        break
                    to = stack[-1].send(to)
            return to
    return wrappedfunc

def get_adj_mat(src, dst):
    matrix = defaultdict(list)
    for src_i, dst_i in zip(src, dst):
        matrix[src_i].append(dst_i)
        matrix[dst_i].append(src_i)
    return matrix


@bootstrap
def set_colour(curr_index, parent_index, adj_mat, colours):
    val = 1
    curr_val, parent_val = colours[curr_index], colours[parent_index]
    for child_index in adj_mat[curr_index]:
        if child_index != parent_index:
            while val in [curr_val, parent_val]:
                val += 1
            colours[child_index] = val
            val += 1
            yield set_colour(child_index, curr_index, adj_mat, colours)
    yield None
    
    
def solve(src, dst, n):
    adj_mat = get_adj_mat(src, dst)
    colours = [-1] * n
    root = 0
    
    colours[root] = 1
    set_colour(0, 0, adj_mat, colours)
    print(max(colours))
    print(*colours)

        
if __name__ == "__main__":
    n = int(input())
    src, dst = [], []
    for _ in range(n-1):
        src_i, dst_i = [int(val) for val in input().split()]
        src.append(src_i-1), dst.append(dst_i-1)
    solve(src, dst, n)

