output_description: * Calculate the possible index and print in sorted order. The output should be separated with a space. Don't print a space after last number.
    * Put a line break in the end.
input_description: The input is given from standard input in the following format.  
  
      
      
      N
      S_1
      S_2
       :
      S_N
      T
attempt: # recursion-version
  
  # http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=GRL_5_A&lang=jp
  # http://penguinshunya.hatenablog.com/entry/2019/07/09/003006
  
  import sys
  
  sys.setrecursionlimit(10000)
  
  inpPh = 0
  debug = True
  # debug = False
  if not debug:
      inpPh = 0
  
  input1 = """
  4
  1 2
  2 3
  2 4
  """[
      1:
  ]
  
  input2 = """
  4
  1 2
  2 4
  4 3
  """[
      1:
  ]
  
  input1bk = """
  4
  0 1 2
  1 2 1
  1 3 3
  """[
      1:
  ]
  
  
  # input1 = input2
  
  output1_2 = """
  5 7
  """
  
  inputXs = [input1, input2, None]
  
  if debug:
      try:
          inputXs.append(inputA0)
      except:
          pass
      else:
          pass
  
  inploc = inpPh - 1  # 0,1,2
  
  if inpPh > 0:
      # print('selected_input:\n'+inputXs[inploc])
      # print('')
      pass
  
  inpX_lst = []
  if debug and inpPh > 0:
      inpX_lst = inputXs[inploc].splitlines()
  
  
  if inpPh == 0:
      n = int(input())
  else:
      n = int(inpX_lst.pop(0))
  
  st_list = []
  noe_vwise = [0 for _ in range(n)]
  
  for i in range(n - 1):
      if inpPh == 0:
          si, ti = tuple(map(lambda x: int(x), input().split()))
      else:
          si, ti = tuple(map(lambda x: int(x), inpX_lst.pop(0).split()))
  
      noe_vwise[si - 1] += 1
      # noe_vwise[ti-1] += 1
      st_list.append((si - 1, ti - 1))
  
  # print(st_list)
  
  from collections import namedtuple
  
  INF = float("inf")
  
  Edge = namedtuple("Edge", ["to", "value"])
  
  
  def Edge(x, y):
      return (x, y)
  
  
  def reroot(n, es_vwise, dp_es_vwise, e_init, noe_vwise, pe_vwise):
  
      def dfs1(v, v_par):
          nonlocal es_vwise, dp_es_vwise, e_init, vpar_v, noe_vwise
          stack = [(v, v_par)]
          while stack:
              (v, v_par) = stack.pop()
  
          # print('es_vwise[v]',v,es_vwise[v])
          ret = e
          # ret = Edge(-INF,-INF)
          ret = (0, 0)
  
          for i in range(len(es_vwise[v])):
              e_local = es_vwise[v][i]
              if e_local[0] == v_par:
                  print("this-part should not be printed")
                  vpar_v[v] = i
                  continue
  
              dp_es_vwise[v][i] = lift(dfs1(e_local[0], v), e_local[1])
              # dp_es_vwise[v][i] = lift(dfs1(e_local[0], v), e_local[1] )
              ret = merge(ret, dp_es_vwise[v][i])
          return ret
  
      def dfs2(v, t):
          # bundlable_parental_edge = t
          nonlocal ans, es_vwise, dp_es_vwise, vpar_v, e_init, noe_vwise
          nonlocal pe_vwise
  
          if vpar_v[v] is not None:
              pass
              # lift(parental_edge, gparental_edge)
              # dp_es_vwise[v][vpar_v[v]] = lift(t,es_vwise[v][vpar_v[v]][1] )
  
          l = len(es_vwise[v])
          dpl = [e_init for i in range(l + 1)]
          dpr = [e_init for i in range(l + 1)]
  
          if pe_vwise[v] is not None:
              v0, v1, w = pe_vwise[v]
              dpr[l] = lift(t, w)
  
          for i in range(l):
              dpl[i + 1] = merge(dpl[i], dp_es_vwise[v][i])
          for i in range(l - 1, -1, -1):
              dpr[i] = merge(dpr[i + 1], dp_es_vwise[v][i])
              # l: 0->1, l-1->l
              # r: l->l-1, 1->0
  
          ans[v] = dpr[0]
  
          for i in range(l):
              if i == vpar_v[v]:
                  print("continue, l", 0)
                  continue
              u = es_vwise[v][i][0]
  
              dfs2(u, merge(dpl[i], dpr[i + 1]))
  
      def lift(a, w):
          if a[1] == 0:
              return (w, 1)
  
          return ((a[0] / a[1]) + w, 1)
          # w is 1, though...
          # return Edge(max(0,a[0]) +w, -INF)
  
      def merge(a, b):
          # print("merge:",a,b)
          return (a[0] + b[0], a[1] + b[1])
  
      nov = n
      vpar_v = [None for i in range(nov)]
      vpar_v0 = [None for i in range(nov)]
  
      for i in range(len(es_vwise)):
          for e in es_vwise[i]:
              vpar_v0[e[0]] = i
  
      ans = [Edge(0, -INF) for i in range(nov)]
  
      dfs1(0, None)
      # 0 must be root?
      dfs2(0, None)
      ret = 0
  
      for i in range(len(ans)):
          # print(f'i:{i} ans:{ans[i]}')
          print(float(ans[i][0] / ans[i][1]))
  
      return ans
  
  
  class reroot_init:
      def __init__(self, n, noe_vwise):
          self.n = n
          self.es_vwise = [[] for i in range(n)]
          self.dp_es_vwise = [[] for i in range(n)]
          self.pe_vwise = [None for i in range(n)]
  
          parental_edge_vwise = self.pe_vwise
  
      def movemain(self):
          reroot(n, self.es_vwise, self.dp_es_vwise, (-INF, -INF), noe_vwise, {})
  
  
  def main():
      rri = reroot_init(n, noe_vwise)
      es_vwise = [[] for i in range(n)]
      dp_es_vwise = [[] for i in range(n)]
      pe_vwise = [None for i in range(n)]
  
      edges_vwise = es_vwise
      parental_edge_vwise = pe_vwise
  
      def v_add_edge(v, u, w):
          es_vwise[v].append((u, w))
          dp_es_vwise[v].append((0, -INF))
  
      for st in st_list:
          s, t = st
          # print(stw)
          v_add_edge(s, t, 1)
          pe_vwise[t] = (s, t, 1)
  
      e_init = (0, 0)
  
      reroot(n, es_vwise, dp_es_vwise, e_init, noe_vwise, pe_vwise)
  
  
  main()
  
problem_description: Statement
  
  Mr.X, who the handle name is T, looked at the list which written N handle
  names, S_1, S_2, ..., S_N.  
  But he couldn't see some parts of the list. Invisible part is denoted `?`.  
    
  Please calculate all possible index of the handle name of Mr.X when you sort
  N+1 handle names (S_1, S_2, ..., S_N and T) in lexicographical order.  
  Note: If there are pair of people with same handle name, either one may come
  first.
samples: [{"input": "2\n    tourist\n    petr\n    e", "output": "1\n    \n\nThere are no invisible part, so there are only one possibility. The sorted\nhandle names are `e`, `petr`, `tourist`, so `e` comes first."}]