import scala.collection.mutable

object Main extends App {
  import scala.io.StdIn._
  solve
  def solve: Unit = {
    val Array(n, m, p) = readLine.trim.split(' ').map(_.toInt)
    if (n == 0) return
    val edges = Array.tabulate(n){_ ⇒ Nil: List[(Int, Int)]}
    for (_ ← 0 until m){
      val Array(u, v, w) = readLine.trim.split(' ').map(_.toInt)
      edges(u) ::= (v, w)
      edges(v) ::= (u, w)
    }
    val children = Array.tabulate(p){_ ⇒ readInt}
    solve(edges, children)
    println()
    solve
  }
  def solve(array: Array[List[(Int, Int)]], children: Array[Int]): Unit = {
    val minCost = Array.tabulate(array.length){_ ⇒ Int.MaxValue}.also(a ⇒ a(0) = 0)
    val queue = mutable.PriorityQueue()(Ordering.by[(Int, Int), Int](_._2).reverse).also(q ⇒ q.enqueue((0, 0)))
    val prevEdges = Array.tabulate(array.length){_ ⇒ Nil: List[Int]}
    while (queue.nonEmpty) {
      val (current, cost) = queue.dequeue()
      if (minCost(current) == cost){
        for ((next, c) ← array(current)){
          if (minCost(next) > cost + c) {
            minCost(next) = cost + c
            prevEdges(next) = List(current)
            queue.enqueue((next, minCost(next)))
          }else if (minCost(next) == cost + c){
            prevEdges(next) ::= current
          }
        }
      }
    }
    val prevPath = Array.tabulate(array.length){_ ⇒ 0D}.also(a ⇒ a(0) = 1)
    val nextPath = Array.tabulate(array.length){_ ⇒ 0D}.also(a ⇒ a(a.length - 1) = 1)
    val nextEdges = Array.tabulate(array.length){_ ⇒ Nil: List[Int]}
    for (next ← prevEdges.indices){
      for (prev ← prevEdges(next)){
        nextEdges(prev) ::= next
      }
    }
    def calPrevPath(current: Int): Unit = {
      for (prev ← prevEdges(current)) {
        calPrevPath(prev)
        prevPath(current) += prevPath(prev)
      }
      prevEdges(current) = Nil
    }
    def calNextPath(current: Int): Unit = {
      for (next ← nextEdges(current)){
        calNextPath(next)
        nextPath(current) += nextPath(next)
      }
      nextEdges(current) = Nil
    }
    calPrevPath(array.length - 1)
    calNextPath(0)
    val wholePath = prevPath.last
    println(children.map(i ⇒ prevPath(i) * nextPath(i).toDouble / wholePath).mkString("\n"))
  }
  implicit class Scope[T](val value: T) extends AnyVal {
    @inline def also(@inline func: T ⇒ Unit): T = {
      func(value)
      value
    }
    @inline def let[A](@inline func: T ⇒ A): A = func(value)
  }
}
