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<string.h>
#include<math.h>
#include<iostream>
#include<algorithm>
using namespace std;
#define maxn 110
int dis[maxn],head[maxn],deg[maxn];
struct Edge{
	int st,to,next,len;
}edge[maxn*maxn*2];
int n,m,p,num;
double hav[maxn];
int pos[maxn],pre[maxn][maxn],cnt[maxn],mark[maxn];
double ans[maxn];
int l,h,q[maxn];
void addedge(int a,int b ,int c)
{
	edge[num].st=a;edge[num].to=b;edge[num].len=c;
	edge[num].next=head[a];head[a]=num++;
}
void dij()
{
	int i,j,k;
	int id,now;
	memset(dis,-1,sizeof(dis));
	memset(mark,0,sizeof(mark));
	memset(cnt,0,sizeof(cnt));
	dis[0]=0;
	while(1){
		now=-1;
		for(i=0;i<n;i++){
			if(dis[i]==-1)continue;
			if((dis[i]<now||now==-1)&&!mark[i]){
				now=dis[i];
				id=i;
			}
		}
		if(now==-1)break;
		mark[id]=1;
		for(i=head[id];i!=-1;i=edge[i].next){
			j=edge[i].to;
			if(dis[j]==-1||dis[id]+edge[i].len<dis[j]){
				dis[j]=dis[id]+edge[i].len;
				cnt[j]=1;
				pre[j][cnt[j]]=id;
			}else if(dis[id]+edge[i].len==dis[j]){
				cnt[j]++;
				pre[j][cnt[j]]=id;
			}
		}
	}
}
void dfs(int now)
{
	if(mark[now])return;
	if(now==0){
		ans[now]=1;
		mark[now]=1;
		return;
	}
	int i;
	ans[now]=0;
	for(i=1;i<=cnt[now];i++){
		dfs(pre[now][i]);
		ans[now]+=ans[pre[now][i]]*1.0*hav[now]/hav[pre[now][i]];
	}
	mark[now]=1;
}
void dfs1(int now)
{
	if(mark[now])return;
	int i,j;
	for(i=1;i<=cnt[now];i++){
		j=pre[now][i];
		deg[j]++;
		dfs1(j);
	}
	mark[now]=1;
}
void work()
{
	int i,j,k;
	memset(hav,0,sizeof(hav));
	hav[n-1]=1;
	l=h=0;
	q[h++]=n-1;
	while(l<h){
		k=q[l++];
		for(i=1;i<=cnt[k];i++){
			j=pre[k][i];
			deg[j]--;
			hav[j]+=hav[k];
			if(deg[j]==0){
				q[h++]=j;
			}
		}
	}
}
			
int main()
{
	int i,j,k;
	int st,to,cost;
	while(scanf("%d%d%d",&n,&m,&p),n+m+p){
		num=0;
		memset(head,-1,sizeof(head));
		while(m--){
			scanf("%d%d%d",&st,&to,&cost);
			addedge(st,to,cost);
			addedge(to,st,cost);
		}
		for(i=1;i<=p;i++){
			scanf("%d",&pos[i]);
		}
		dij();
		if(dis[n-1]==-1)while(1);
		memset(mark,0,sizeof(mark));
		memset(deg,0,sizeof(deg));
		dfs1(n-1);
		work();
		/*for(i=0;i<n;i++){
			printf("%d %d %d\n",i,deg[i],cnt[i]);
		}*/
		for(i=0;i<n;i++){
			ans[i]=0;
		}
		
		memset(mark,0,sizeof(mark));
		dfs(n-1);
		for(i=1;i<=p;i++){
			printf("%.8f\n",ans[pos[i]]);
		}
		putchar('\n');
	}
	return 0;
}