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 
"""
#If FastIO not needed, used this and don't forget to strip
#import sys, math
#input = sys.stdin.readline
"""

import os
import sys
from io import BytesIO, IOBase
import heapq as h 
from bisect import bisect_left, bisect_right

from types import GeneratorType
BUFSIZE = 8192
class FastIO(IOBase):
    newlines = 0
 
    def __init__(self, file):
        import os
        self.os = os
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None
 
    def read(self):
        while True:
            b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()
 
    def readline(self):
        while self.newlines == 0:
            b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()
 
    def flush(self):
        if self.writable:
            self.os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)
 
 
class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")
 
 
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

import collections as col
import math, string

def getInts():
    return [int(s) for s in input().split()]

def getInt():
    return int(input())

def getStrs():
    return [s for s in input().split()]

def getStr():
    return input()

def listStr():
    return list(input())

MOD = 10**9+7


"""
Each node and all its neighbours must be different, so the minimum number of colours is X + 1 where the max number of neighbours any node has is 1
Assign colours by BFS: every node must have a different colour to 1) its parent 2) its parent's parent 3) the other children of its parent

"""

def solve():
    N = getInt()
    graph = col.defaultdict(set)
    for n in range(N-1):
        U, V = getInts()
        U -= 1
        V -= 1
        graph[U].add(V)
        graph[V].add(U)
    def bfs(node):
        import collections as col
        nodes.remove(node)
        cols[node] = 1
        queue = col.deque([])
        queue.append((node,1,-1,-1))
        while queue:
            node, colour, parent, parent_col = queue.popleft()
            y = set([j+1 for j in range(len(graph[node])+1)])
            if colour in y: y.remove(colour)
            if parent_col in y: y.remove(parent_col)
            for neighbour in graph[node]:
                if neighbour in nodes:
                    nodes.remove(neighbour)
                    new_col = next(iter(y))
                    y.remove(new_col)
                    cols[neighbour] = new_col
                    queue.append((neighbour,new_col,node,colour))
                    
        return
    nodes = set([j for j in range(N)])
    cols = [-1]*N
    bfs(0)
    print(max(cols))
    print(*cols)
    return
    
    

    
#for _ in range(getInt()):
solve()