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 <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <cassert>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>
#include <list>


using namespace std;

#ifdef _MSC_VER
#define __typeof__ decltype
template <class T> int __builtin_popcount(T n) { return n ? 1 + __builtin_popcount(n & (n - 1)) : 0; }
#endif

#define foreach(it, c) for (__typeof__((c).begin()) it=(c).begin(); it != (c).end(); ++it)
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define CLEAR(arr, val) memset(arr, val, sizeof(arr))

#define rep(i, n) for (int i = 0; i < n; ++i)

template <class T> void max_swap(T& a, const T& b) { a = max(a, b); }
template <class T> void min_swap(T& a, const T& b) { a = min(a, b); }

typedef long long ll;
typedef pair<int, int> pint;

const double EPS = 1e-8;
const double PI = acos(-1.0);
const int dx[] = { 0, 1, 0, -1 };
const int dy[] = { 1, 0, -1, 0 };


struct Edge
{
	int to, cost;
	Edge(int to, int cost)
		: to(to), cost(cost) {}
};

vector<vector<int> > clean(const vector<vector<int> >& e)
{
	int n = e.size();
	vector<bool> on_min_path(n);
	queue<int> q;
	on_min_path[n - 1] = true;
	q.push(n - 1);
	while (!q.empty())
	{
		int cur = q.front(); q.pop();
		for (int i = 0; i < e[cur].size(); ++i)
		{
			int to = e[cur][i];
			if (!on_min_path[to])
			{
				on_min_path[to] = true;
				q.push(to);
			}
		}
	}

	vector<vector<int> > res(n);
	for (int i = 0; i < n; ++i)
		for (int j = 0; j < e[i].size(); ++j)
			if (on_min_path[i] && on_min_path[e[i][j]])
				res[i].push_back(e[i][j]);
	return res;
}
vector<vector<int> > prev_nodes(const vector<vector<Edge> >& edges)
{
	int n = edges.size();

	const int INF = 1e7;
	vector<int> dis(n, INF);
	vector<vector<int> > prevv(n);
	priority_queue<pint, vector<pint>, greater<pint> > q;
	dis[0] = 0;
	q.push(pint(0, 0));
	while (!q.empty())
	{
		pint tt = q.top(); q.pop();
		int cur = tt.second, cost = tt.first;

		if (cost > dis[cur])
			continue;

		foreach (e, edges[cur])
		{
			int to = e->to, nc = cost + e->cost;
			if (nc < dis[to])
			{
				dis[to] = nc;
				prevv[to].clear();
				prevv[to].push_back(cur);
				q.push(pint(nc, to));
			}
			else if (nc == dis[to])
				prevv[to].push_back(cur);
		}
	}

	return clean(prevv);
}

vector<vector<int> > rev(const vector<vector<int> >& e)
{
	vector<vector<int> > res(e.size());
	for (int i = 0; i < e.size(); ++i)
		for (int j = 0; j < e[i].size(); ++j)
			res[e[i][j]].push_back(i);
	return res;
}

double in_paths(vector<double>& dp, const vector<vector<int> >& e, int v)
{
	if (dp[v] != -1)
		return dp[v];
	else if (e[v].empty())
		return dp[v] = 1;

	double res = 0;
	for (int i = 0; i < e[v].size(); ++i)
		res += in_paths(dp, e, e[v][i]);
	return dp[v] = res;
}
int main()
{
	int n, m, p;
	while (cin >> n >> m >> p, n)
	{
		vector<vector<Edge> > edges(n);
		for (int i = 0; i < m; ++i)
		{
			int a, b, c;
			cin >> a >> b >> c;
			edges[a].push_back(Edge(b, c));
			edges[b].push_back(Edge(a, c));
		}
		vector<vector<int> > prevv = prev_nodes(edges);
		//for (int i = 0; i < n; ++i)
		//{
		//	printf("%d: ", i);
		//	for (int j = 0; j < prevv[i].size(); ++j)
		//		printf("%d ", prevv[i][j]);
		//	puts("");
		//}puts("");

		vector<double> in(n, -1), out(n, -1);
		in_paths(in, prevv, n - 1);
		in_paths(out, rev(prevv), 0);

		vector<double> paths(n);
		for (int i = 0; i < n; ++i)
			if (in[i] != -1)
				paths[i] = in[i] * out[i];
		double total_paths = paths[0];

		//for (int i = 0; i < n; ++i)
		//{
		//	printf("%d: %f %f\n", i, in[i], out[i]);
		//}

		while (p--)
		{
			int c;
			cin >> c;
			
			printf("%.8f\n", paths[c] / total_paths);
		}
		puts("");
	}
}