### constant

MAX_INT = 1 << 30

### subroutines

def count_routes(k, prevs)
  return $counts[k] if ! $counts[k].nil?

  count = 0

  for prv in prevs[k]
    count += count_routes(prv, prevs)
  end

  $counts[k] = count
end

### 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

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

  total = count_routes(n - 1, prevs)
  $counts[0] = total
  #p $counts

  for ci in cis
    puts "%.8f" % ($counts[ci].to_f / total)
  end
  puts
end