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"
using namespace std;

using ld = long double;
const ld eps = 1e-9;
struct aa {
	int now;
	int time;
};
struct edge {
	int from;
	int to;
	int w;
};
class Compare {
public:
	bool operator()(const aa&l, const aa&r) {
		return l.time> r.time;
	}
};	//aa?????????????????¶

vector<int>topo_sort(const vector<vector<int>>&edges) {
	int size_ = edges.size();
	vector<int>nums(size_);
	for (const auto& es : edges) {
		for (auto e : es) {
			nums[e]++;
		}
	}
	queue<int>que;
	for (int i = 0; i < size_; ++i) {
		if (!nums[i]) {
			que.push(i);
		}
	}
	vector<int>topo;
	while (!que.empty()) {
		int ver(que.front());
		topo.push_back(ver);
		que.pop();
		for (auto e : edges[ver]) {
			nums[e]--;
			if (!nums[e])que.push(e);
		}
	}
	if (topo.size() == size_)return topo;
	else return vector<int>();
}

int main() {
	while (1) {
		int N, M, P; cin >> N >> M >> P;
		if (!N)break;
		vector<vector<int>>edges(N),revedges(N);
		{
			vector<vector<edge>>dummyedges(N);
			for (int i = 0; i < M; ++i) {
				int a, b, w; cin >> a >> b >> w;
				dummyedges[a].push_back(edge{ a,b,w });
				dummyedges[b].push_back(edge{ b,a,w });
			}
			vector<int>memo(N,1e9);
			vector<vector<edge>>tos(N);
			memo[0] = 0;
			priority_queue<aa, vector<aa>, Compare>que;
			que.push(aa{ 0,0 });
			while (!que.empty()) {
				aa atop(que.top());
				que.pop();
				for (auto e : dummyedges[atop.now]) {
					const int nexttime = atop.time + e.w;
					if (memo[e.to] > nexttime) {
						memo[e.to] = nexttime;
						tos[e.to].clear();
						tos[e.to].push_back(e);
						que.push(aa{ e.to,nexttime });
					}
					else if (memo[e.to] == nexttime) {
						tos[e.to].push_back(e);
					}
				}
			}
			for (auto atos : tos) {
				for (auto e:atos) {
					edges[e.from].push_back(e.to);
					revedges[e.to].push_back(e.from);
				}
			}
		}
		vector<int>topo(topo_sort(edges));
		ld total;
		{
			vector<ld>fs(N, 0);
			fs[0] = 1;
			for (int i = 0; i < N; ++i) {
				int from = topo[i];
				for (auto to : edges[from]) {
					fs[to] += fs[from];
				}
			}
			total = fs[N - 1];
		}
		
		
		while (P--) {
			int a; cin >> a;
			vector<ld>fs(N);
			fs[0] = 1;
			for (int i = 0; i < N; ++i) {
				int from = topo[i];
				for (auto to : edges[from]) {
					if (from == a || to == a)continue;
					fs[to] += fs[from];
				}
			}
			ld ans = 1-fs[N - 1] / total;
			cout << fixed << setprecision(12) << ans << endl;
		}
		cout << endl;
	}
	return 0;
}