### constant

MAX_INT = 1 << 30

### main

loop do
  n, m, pn = gets.split.map(&:to_i)
  break if (n | m | pn) == 0

  nbrs = n.times.map{[]}
  edges = n.times.map{[]}

  m.times do
    i, j, w = gets.split.map(&:to_i)
    nbrs[i] << j
    nbrs[j] << i
    edges[i][j] = edges[j][i] = w
  end
  #p nbrs
  #p edges

  cis = pn.times.map{gets.to_i}
  #p cis

  dists = n.times.map{MAX_INT}
  prevs = n.times.map{[]}

  dists[0] = 0
  q = [0]

  while ! q.empty?
    u = q.min{|a, b| dists[a] <=> dists[b]}
    q.delete(u)

    next if u == n - 1

    du = dists[u]

    for v in nbrs[u]
      dv = dists[v]
      ndv = du + edges[u][v]

      if dv > ndv
        dists[v] = ndv
        prevs[v] = [u]
        if dv >= MAX_INT
          q << v
        end
      elsif dv == ndv
        prevs[v] << u
      end
    end
  end
  #p prevs

  nexts = n.times.map{[]}
  for i in (0...n)
    for j in prevs[i]
      nexts[j] << i
    end
  end
  #p nexts

  $counts = n.times.map{0}
  $ncounts = n.times.map{0}
  $counts[0] = 1
  q = [0]

  while ! q.empty?
    u = q.shift

    if prevs[u].length > $ncounts[u]
      q << u
      next
    end

    cu = $counts[u]

    for v in nexts[u]
      cv = $counts[v]
      $counts[v] += cu
      $ncounts[v] += 1
      if cv == 0
        q << v
      end
    end
  end
  #p $counts

  $pbs = n.times.map{0.0}
  $npbs = n.times.map{0}
  $pbs[n - 1] = 1.0
  q = [n - 1]

  while ! q.empty?
    u = q.shift

    if nexts[u].length > $npbs[u]
      q << u
      next
    end

    pu = $pbs[u]
    cu = $counts[u]

    for v in prevs[u]
      pv = $pbs[v]
      $pbs[v] += pu * $counts[v] / cu
      $npbs[v] += 1
      if pv == 0.0
        q << v
      end
    end
  end
  #p $pbs

  for ci in cis
    puts "%.8f" % $pbs[ci]
  end
  puts
end