output_description: If 9 is contained in the decimal notation of N, print `Yes`; if not, print
  `No`.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
attempt: from itertools import permutations
  
  inf = 10**9
  n, m, r1 = map(int, input().split())
  r = list(map(int, input().split()))
  abc = [list(map(int, input().split())) for _ in range(m)]
  d = [[inf] * n for i in range(n)]
  for ai, bi, ci in abc:
      d[ai - 1][bi - 1] = ci
      d[bi - 1][ai - 1] = ci
  for k in range(n):
      for i in range(n - 1):
          for j in range(i, n):
              dk = d[i][k] + d[k][j]
              if d[i][j] > dk:
                  d[j][i] = dk
                  d[i][j] = dk
  permutations(r)
  ans = inf
  p = list(permutations(r))
  for pi in p:
      res = 0
      for i in range(r1 - 1):
          res += d[pi[i] - 1][pi[i + 1] - 1]
      if ans > res:
          ans = res
  print(ans)
  
problem_description: Statement
  
  It is September 9 in Japan now.
  
  You are given a two-digit integer N. Answer the question: Is 9 contained in
  the decimal notation of N?
samples: [{"input": "29", "output": "Yes\n    \n\nThe one's digit of 29 is 9.\n\n* * *"}, {"input": "72", "output": "No\n    \n\n72 does not contain 9.\n\n* * *"}, {"input": "91", "output": "Yes"}]