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: #!/usr/bin/env python3
  import sys
  
  
  def solve(
      N: int,
      M: int,
      R: int,
      r: "List[int]",
      A: "List[int]",
      B: "List[int]",
      C: "List[int]",
  ):
      """
      Warshall-Floyd
      input:  c[|V|][|V|]
              input example to from cost
              (c[i][i] == 0)
      Output: Minimun cost of all paths in the inputed graph
      """
      V = N
      INF = 1 << 32
      d = [[INF] * (N + 1) for i in range(N + 1)]
  
      for i in range(M):
          d[A[i]][B[i]] = C[i]
          d[B[i]][A[i]] = C[i]
  
      for k in range(N + 1):
          for i in range(N + 1):
              if d[i][k] == INF:
                  continue
              for j in range(N + 1):
                  if d[k][j] == INF:
                      continue
                  d[i][j] = min(d[i][j], d[i][k] + d[k][j])
  
      ans = INF
  
      from itertools import product
  
      for i in product(r, repeat=len(r)):
          # print(i)
          if len(i) != len(set(i)):
              continue
          ta = 0
          for j in range(1, len(i)):
              ta += d[i[j - 1]][i[j]]
  
          ans = min(ans, ta)
  
      print(ans)
  
      return
  
  
  # Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
  def main():
      def iterate_tokens():
          for line in sys.stdin:
              for word in line.split():
                  yield word
  
      tokens = iterate_tokens()
      N = int(next(tokens))  # type: int
      M = int(next(tokens))  # type: int
      R = int(next(tokens))  # type: int
      r = [int(next(tokens)) for _ in range(R)]  # type: "List[int]"
      A = [int()] * (M)  # type: "List[int]"
      B = [int()] * (M)  # type: "List[int]"
      C = [int()] * (M)  # type: "List[int]"
      for i in range(M):
          A[i] = int(next(tokens))
          B[i] = int(next(tokens))
          C[i] = int(next(tokens))
      solve(N, M, R, r, A, B, C)
  
  
  if __name__ == "__main__":
      main()
  
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"}]