Problem: The best night ever in the world has come! It's 8 p.m. of December 24th, yes, the night of Cristmas Eve. Santa Clause comes to a silent city with ringing bells. Overtaking north wind, from a sleigh a reindeer pulls she shoot presents to soxes hanged near windows for children.

The sleigh she is on departs from a big christmas tree on the fringe of the city. Miracle power that the christmas tree spread over the sky like a web and form a paths that the sleigh can go on. Since the paths with thicker miracle power is easier to go, these paths can be expressed as undirected weighted graph.

Derivering the present is very strict about time. When it begins dawning the miracle power rapidly weakens and Santa Clause can not continue derivering any more. Her pride as a Santa Clause never excuses such a thing, so she have to finish derivering before dawning.

The sleigh a reindeer pulls departs from christmas tree (which corresponds to 0th node), and go across the city to the opposite fringe (n-1 th node) along the shortest path. Santa Clause create presents from the miracle power and shoot them from the sleigh the reindeer pulls at his full power. If there are two or more shortest paths, the reindeer selects one of all shortest paths with equal probability and go along it.

By the way, in this city there are p children that wish to see Santa Clause and are looking up the starlit sky from their home. Above the i-th child's home there is a cross point of the miracle power that corresponds to c[i]-th node of the graph. The child can see Santa Clause if (and only if) Santa Clause go through the node.

Please find the probability that each child can see Santa Clause.

Constraints

* 3 ≤ n ≤ 100
* There are no parallel edges and a edge whose end points are identical.
* 0 < weight of the edge < 10000

Input

Input consists of several datasets.

The first line of each dataset contains three integers n, m, p, which means the number of nodes and edges of the graph, and the number of the children. Each node are numbered 0 to n-1.

Following m lines contains information about edges. Each line has three integers. The first two integers means nodes on two endpoints of the edge. The third one is weight of the edge.

Next p lines represent c[i] respectively.

Input terminates when n = m = p = 0.

Output

For each dataset, output p decimal values in same order as input. Write a blank line after that.

You may output any number of digit and may contain an error less than 1.0e-6.

Example

Input

3 2 1
0 1 2
1 2 3
1
4 5 2
0 1 1
0 2 1
1 2 1
1 3 1
2 3 1
1
2
0 0 0


Output

1.00000000

0.50000000
0.50000000

Solution (in CPP):

Solution:
#include <iostream>
#include <iomanip>
#include <sstream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <cassert>
#include <climits>
#include <queue>
#include <set>
#include <map>
#include <valarray>
#include <bitset>
#include <stack>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
#define chmax(a,b) (a<b?(a=b,1):0)
#define chmin(a,b) (a>b?(a=b,1):0)
#define valid(y,x,h,w) (0<=y&&y<h&&0<=x&&x<w)
typedef long long ll;
typedef pair<int,int> pii;
const int INF = 1<<29;
const double PI = acos(-1);
const double EPS = 1e-8;

vector<pii> g[100];
int dist[100];
int dist1[100];
double dp1[100];
double dp[100];
int c[100];

int main() {
  int n,m,p;
  while(cin>>n>>m>>p,n||m||p) {
    REP(i,n)g[i].clear();
    REP(i,m) {
      int a, b, d;
      cin>>a>>b>>d;
      g[a].push_back(pii(b,d));
      g[b].push_back(pii(a,d));
    }
    REP(i,p) cin >> c[i];
    priority_queue<pii> Q;
    Q.push(pii(0,0));
    memset(dist,0x3f,sizeof(dist));
    dist[0] = 0;
    vector<int> order;
    int minDist = INF;
    while(!Q.empty()) {
      pii p = Q.top(); Q.pop();
      int now = p.second;
      int dis = -p.first;
      if (dist[now] < dis) continue;
      if (now == n-1) {
        minDist = dis;
      }
      order.push_back(now);
      FOR(it, g[now]) {
        int e=it->first;
        if (dist[e] > dis + it->second) {
          dist[e] = dis + it->second;
          Q.push(pii(-dist[e],e));
        }
      }
    }
    
    memset(dist1,0x3f,sizeof(dist1));
    memset(dp1,0,sizeof(dp1));
    Q.push(pii(0,n-1));
    dist1[n-1] = 0;
    dp1[n-1] = 1;
    while(!Q.empty()) {
      pii p = Q.top(); Q.pop();
      int now = p.second;
      int dis = -p.first;
      if (dist1[now] < dis) continue;
      FOR(it, g[now]) {
        int e=it->first;
        if (dist1[e] > dis + it->second) {
          dist1[e] = dis + it->second;
          // cout << now << " " << e << " " << dist[e] << " " << dist1[e] << endl;
          if (dist[e] + dist1[e] == minDist) {
            dp1[e] = dp1[now];
          }
          Q.push(pii(-dist1[e],e));
        } else if (dist1[e] == dis + it->second) {
          if (dist[e] + dist1[e] == minDist) {
            dp1[e] += dp1[now];
          }
        }
      }
    }

    // REP(i,n) cout << dp1[i] << " "; cout << endl;

    memset(dp,0,sizeof(dp));
    dp[0] = 1;
    FOR(it, order) {
      int e = *it;
      FOR(jt, g[e]) {
        int f = jt->first;
        if (dist[e] + dist1[f] + jt->second == minDist) {
          dp[f] += dp[e] * dp1[f]/dp1[e];
        }
      }
    }

    REP(i,p) {
      printf("%.10f\n", dp[c[i]]);
    }
    puts("");
  }
}