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 bisect import bisect_left,bisect_right
# from collections import defaultdict as dd
# from collections import deque, Counter
# from heapq import heappop,heappush,heapify,merge
# from itertools import permutations, accumulate, product
# from math import gcd,sqrt,ceil
# toBin=lambda x:bin(x).replace("0b","")
# I=lambda:map(int,input().split())
# inf=float("inf");DIRS=[[1,0],[-1,0],[0,1],[0,-1]];CHARS="abcdefghijklmnopqrstuvwxyz";MOD=10**9+7
# ###### Fill out N to calculate combinations#####################
# # N=300010;fac=[1]*N;invfac=[1]*N
# # for i in range(2,N):fac[i]=fac[i-1]*i%MOD
# # invfac[N-1]=pow(fac[N-1],MOD-2,MOD)
# # for i in range(N-1)[::-1]:invfac[i]=invfac[i+1]*(i+1)%MOD
# # def c(i,j):return 0 if i<j else fac[i]*invfac[j]*invfac[i-j]
# ###############################################################
# input=sys.stdin.readline

class UnionFind:
    def __init__(self,n):self.p=list(range(n));self.rank=[0]*n
    def find(self,x):
        if x!=self.p[x]:self.p[x]=self.find(self.p[x])
        return self.p[x]
    def union(self,x, y):
        px,py=self.find(x),self.find(y)
        if px==py:return 0
        self.p[py]=px
        self.rank[px]+=self.rank[py]
        return 1

from types import GeneratorType
def cache(f,queue=[]):
    def wrappedfunc(*args,**kwargs):
        if queue:return f(*args, **kwargs)
        else:
            to = f(*args,**kwargs)
            while True:
                if isinstance(to,GeneratorType):queue.append(to);to = next(to)
                else:
                    if not queue:break
                    queue.pop()
                    if not queue:break
                    to=queue[-1].send(to)
            return to
    return wrappedfunc

def query(x,y):
    print("?",x,y,flush=True)
    return int(input())

# DP,BS,Greedy,Graph,Contribution,IE,Game,Reverse simulation
def main():
    """
    was able to figure out the min number of colors but stuck on how
    to assign them efficiently. -20m mark.
    24m - after finding out how many colors are needed, for every
    node, keep track of all the possible ones and assign the most
    recent one, unless its equal to itself or parent. assign to children.
    min color = max of children + parent + 1
    start 28m
    """
    def f(ch,par):
        color=1
        for neigh in G[ch]:
            if neigh!=par:
                if color in [colors[par],colors[ch]]:color+=1
                if color in [colors[par],colors[ch]]:color+=1
                colors[neigh]=color;color+=1;f(neigh,ch)
    n=int(input());G={i:[] for i in range(n)};mi=0
    for _ in range(n-1):u,v=I();u-=1;v-=1;G[u].append(v);G[v].append(u);
    for i in range(n):mi=max(mi,len(G[i])+1)
    colors=[0]*n;colors[0]=1;f(0,-1)
    print(mi);print(*colors)

###### Comment this out for Python 3 + imports at the top #####
# if __name__ == "__main__":
#     main()

###### Uncomment this for Python 3 (for deep recursion) ######
from sys import stdin, setrecursionlimit
import threading
from collections import defaultdict as dd
setrecursionlimit(5*10**5);input=stdin.buffer.readline;I=lambda:map(int,input().split())
threading.stack_size(10**8)
t = threading.Thread(target=main)
t.start()
t.join()