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<cstdio>
#include<cstring>
#include<vector>
#include<map>
#include<algorithm>
#include<functional>
#include<queue>
using namespace std;
typedef pair<int,int>P;
const int N=100;

int vertex[N];
vector<vector<int> >edge(N);
vector<P> v(N);

//ツ陳クツ点xツつゥツづァツ陳クツ点yツづ鳴行ツつュツ本ツ青板づ個古つ青板づーツ仰づ淞づゥ
void F(int x,int y,int n,double(&dp)[N])
{
	int i,j,k;
	fill(dp,dp+N,0.);
	dp[x]=1;
	vector<P>::iterator ite1,ite2;
	ite1=lower_bound(v.begin(),v.end(),P(vertex[x],0));
	ite2=lower_bound(v.begin(),v.end(),P(vertex[y]+1,-1));
	for(;ite1!=ite2;++ite1)
	{
		j=ite1->second;
		for(k=0;k<edge[j].size();++k)dp[edge[j][k]]+=dp[j];
	}
}
int main()
{
	int n,m,p,x,y,w,i,dist[N][N],X=0x3f3f3f3f;
	while(scanf("%d%d%d",&n,&m,&p),n)
	{
		memset(dist,X,sizeof(dist));
		memset(vertex,X,sizeof(vertex));
		for(i=0;i<n;++i)edge[i].clear();
		while(m--)
		{
			scanf("%d%d%d",&x,&y,&w);
			dist[y][x]=dist[x][y]=w;
		}
		priority_queue<P,vector<P>,greater<P> >q;
		q.push(P(0,0));
		while(!q.empty())
		{
			P p(q.top());q.pop();
			if(vertex[p.second]<=p.first)continue;
			vertex[p.second]=p.first;
			for(i=0;i<n;++i)if((w=dist[p.second][i])!=X)q.push(P(p.first+w,i));
		}
		bool flag[N]={};
		q.push(P(0,n-1));
		while(!q.empty())
		{
			P p(q.top());q.pop();
			for(i=0;i<n;++i)
				if(w=dist[i][p.second],vertex[i]+w==vertex[p.second])
				{
					edge[i].push_back(p.second);
					if(!flag[i])
					{
						q.push(P(0,i));
						flag[i]=1;
					}
				}
		}
		double dp[N];
		for(i=0;i<n;++i)v[i]=P(vertex[i],i);
		for(i=n;i<N;++i)v[i]=P(X,X);
		sort(v.begin(),v.end());
		F(0,n-1,n,dp);
		while(p--)
		{
			scanf("%d",&x);
			if(x!=n-1&&edge[x].empty())printf("%.9f\n",0.);
			else
			{
				double dp2[N]={},dp3[N]={};
				F(x,n-1,n,dp2);
				F(0,x,n,dp3);
				printf("%.9f\n",dp2[n-1]*dp3[x]/dp[n-1]);
			}
		}
	}
	return 0;
}