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<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;


struct Edge{
	Edge(int arg_to,int arg_cost){
		to = arg_to;
		cost = arg_cost;
	}
	int to,cost;
};

enum Type{
	from_S,
	from_G,
};

struct Info{
	Info(int arg_node_id,int arg_sum_cost){
		node_id = arg_node_id;
		sum_cost = arg_sum_cost;
	}
	bool operator<(const struct Info &arg) const{ //総コストの昇順(PQ)
		return sum_cost > arg.sum_cost;
	}
	int node_id,sum_cost;
};

int N,M,P;
int C[100001];
int min_dist[100][2];
bool calculated[100][2];
double path_num[100][2],ans[100];
vector<Edge> G[100];
vector<int> DAG_G[100],rev_DAG_G[100];

void dijkstra(Type type,int start){

	for(int i = 0; i < N; i++)min_dist[i][type] = BIG_NUM;
	min_dist[start][type] = 0;

	priority_queue<Info> Q;
	Q.push(Info(start,0));

	int next_node,next_cost;

	while(!Q.empty()){

		if(Q.top().sum_cost > min_dist[Q.top().node_id][type]){
			Q.pop();
		}else{

			for(int i = 0; i < G[Q.top().node_id].size(); i++){
				next_node = G[Q.top().node_id][i].to;
				next_cost = Q.top().sum_cost+G[Q.top().node_id][i].cost;

				if(min_dist[next_node][type] > next_cost){
					min_dist[next_node][type] = next_cost;
					Q.push(Info(next_node,next_cost));
				}
			}

			Q.pop();
		}
	}
}

//from_S:あるノードからゴール方向への経路数、from_G:あるノードからスタート方向への経路数
double recursive(Type type,int node_id,int goal){

	if(calculated[node_id][type])return path_num[node_id][type];

	if(node_id == goal)return 1.0;

	if(type == from_S){

		for(int i = 0; i < DAG_G[node_id].size(); i++){
			path_num[node_id][type] += recursive(type,DAG_G[node_id][i],goal);
		}

	}else{ //type == from_G

		for(int i = 0; i < rev_DAG_G[node_id].size(); i++){
			path_num[node_id][type] += recursive(type,rev_DAG_G[node_id][i],goal);
		}
	}
	calculated[node_id][type] = true;

	return path_num[node_id][type];
}

void func(){

	for(int i = 0; i < N; i++){
		G[i].clear();
		DAG_G[i].clear();
		rev_DAG_G[i].clear();
	}

	int from,to,cost;
	for(int loop = 0; loop < M; loop++){
		scanf("%d %d %d",&from,&to,&cost);
		G[from].push_back(Edge(to,cost));
		G[to].push_back(Edge(from,cost));
	}

	for(int i = 0; i < P; i++)scanf("%d",&C[i]);

	dijkstra(from_S,0);
	dijkstra(from_G,N-1);

	int next_node;
	//最短経路DAGを作る
	for(int i = 0; i < N; i++){
		for(int k = 0; k < G[i].size(); k++){
			next_node = G[i][k].to;
			if(min_dist[i][from_S]+G[i][k].cost+min_dist[next_node][from_G] == min_dist[N-1][from_S]){ //最短経路上の辺
				DAG_G[i].push_back(next_node);
				rev_DAG_G[next_node].push_back(i);
			}
		}
	}

	for(int i = 0; i < N; i++){
		for(int k = 0; k < 2; k++){
			calculated[i][k] = false;
			path_num[i][k] = 0;
		}
	}

	//再帰的に、そのノードを経由する経路数を計算する
	recursive(from_S,0,N-1);
	recursive(from_G,N-1,0);

	for(int i = 0; i < N; i++){
		ans[i] = path_num[i][from_G]*path_num[i][from_S]/path_num[0][from_S];
	}

	for(int i = 0; i < P; i++){
		printf("%.10lf\n",ans[C[i]]);
	}
	printf("\n");
}

int main(){

	while(true){
		scanf("%d %d %d",&N,&M,&P);
		if(N == 0 && M == 0 && P == 0)break;

		func();
	}

	return 0;
}