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<stdio.h>
#include<algorithm>
#include<vector>
#include<queue>
using namespace std;
int g[110][110];
vector<int>g2[110];
int p[11000];
int q[11000];
int r[11000];
pair<int,int> pt[110];
double dp[110];
double dp2[110];
int main(){
    int a,b,c;
    while(scanf("%d%d%d",&a,&b,&c),a){
        for(int i=0;i<a;i++)for(int j=0;j<a;j++)g[i][j]=999999999;
        for(int i=0;i<a;i++)g[i][i]=0;
        for(int i=0;i<a;i++){g2[i].clear();}
        for(int i=0;i<b;i++){
            scanf("%d%d%d",p+i,q+i,r+i);
            g[p[i]][q[i]]=g[q[i]][p[i]]=r[i];
        }
        for(int k=0;k<a;k++)for(int i=0;i<a;i++)for(int j=0;j<a;j++)
            g[i][j]=min(g[i][j],g[i][k]+g[k][j]);
        for(int i=0;i<b;i++){
            int P=p[i];
            int Q=q[i];
            int R=r[i];
            if(g[0][P]+R==g[0][Q]&&g[Q][a-1]+R==g[P][a-1]){
                g2[P].push_back(Q);
            }
            swap(P,Q);
            if(g[0][P]+R==g[0][Q]&&g[Q][a-1]+R==g[P][a-1]){
                g2[P].push_back(Q);
            }
        }
        for(int i=0;i<110;i++)dp[i]=0;
        dp[0]=1;
        for(int i=0;i<a;i++)pt[i]=make_pair(g[0][i],i);
        std::sort(pt,pt+a);
        for(int i=0;i<a;i++){
            int at=pt[i].second;
            for(int j=0;j<g2[at].size();j++){
                dp[g2[at][j]]+=dp[at];
            }
        }
		double tot=dp[a-1];
		
        for(int i=0;i<c;i++){
            int t;scanf("%d",&t);
			for(int j=0;j<a;j++)dp2[j]=0;
			dp2[t]=1;
			for(int j=0;j<a;j++){
				int at=pt[j].second;
				for(int k=0;k<g2[at].size();k++){
					dp2[g2[at][k]]+=dp2[at];
				}
			}
			printf("%.12f\n",dp2[a-1]/tot*dp[t]);
        }
        printf("\n");
    }
}