output_description: Print the string resulting from shifting each character of S by N in
  alphabetical order.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
      S
attempt: import sys
  
  sys.setrecursionlimit(10**9)
  n = int(input())
  ab = []
  t = [[] for _ in range(n)]
  for _ in range(n - 1):
      a, b = map(lambda x: int(x) - 1, input().split())
      t[a].append(b)
      t[b].append(a)
      ab.append((min(a, b), max(a, b)))
  k = max(map(len, t))
  d = {}
  
  
  def dfs(pre, cur, col):
      cn = 1 if col != 1 else 2
      for i in t[cur]:
          if i == pre:
              continue
          d[(min(i, cur), max(i, cur))] = cn
          dfs(cur, i, cn)
          cn += 1
          if col == cn:
              cn += 1
  
  
  dfs(0, 0, 0)
  print(k)
  for i in ab:
      print(d[i])
  
problem_description: Statement
  
  We have a string S consisting of uppercase English letters. Additionally, an
  integer N will be given.
  
  Shift each character of S by N in alphabetical order (see below), and print
  the resulting string.
  
  We assume that `A` follows `Z`. For example, shifting `A` by 2 results in `C`
  (`A` \to `B` \to `C`), and shifting `Y` by 3 results in `B` (`Y` \to `Z` \to
  `A` \to `B`).
samples: [{"input": "2\n    ABCXYZ", "output": "CDEZAB\n    \n\nNote that `A` follows `Z`.\n\n* * *"}, {"input": "0\n    ABCXYZ", "output": "ABCXYZ\n    \n\n* * *"}, {"input": "13\n    ABCDEFGHIJKLMNOPQRSTUVWXYZ", "output": "NOPQRSTUVWXYZABCDEFGHIJKLM"}]