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<iostream>
#include<vector>
#include<cassert>
#include<algorithm>
using namespace std;
#define rep(i, n) for ( int i = 0; i < n; i++ )
#define MAX 100
#define INFTY (1<<21)

void dijkstra( int n, int G[MAX][MAX],  vector<int> p[MAX] ){
  int d[MAX];
  bool visited[MAX];

  rep(i, n) p[i].clear();

  rep(i, n){
    d[i] = INFTY;
    visited[i] = false;
  }

  d[0] = 0;

  int cnt = 0;
  while(1){
    int minv = INFTY;
    int u = -1;
    rep(i, n){
      if ( !visited[i] && minv > d[i] ) {
	u = i;
	minv = d[i];
      }
    }
    if ( u == -1 ) break;
    visited[u] = true;
    cnt++;

    rep(v, n){
      if ( !visited[v] && G[u][v] != INFTY ){
	int cost = d[u] + G[u][v];
	if ( cost == d[v] ){
	  p[v].push_back(u);
	} else if ( cost < d[v] ){
	  p[v].clear();
	  p[v].push_back(u);
	  d[v] = cost;
	}
      }
    }
  }

  assert( cnt == n );
}

void tsort( int n, int u, bool T[MAX][MAX], vector<int> &order, bool visited[MAX], vector<int> p[MAX] ){
  visited[u] = true;
  rep(v, n) if ( T[u][v] && !visited[v]) tsort(n, v, T, order, visited, p);

  if ( u == 0 || u == n-1 || p[u].size() > 0 ){
    order.push_back(u);
  }
}

void parse( int n, int u, vector<int> p[MAX], bool inpath[MAX]){
  inpath[u] = true;
  for ( int i = 0; i < p[u].size(); i++ ){
    int v = p[u][i];
       if ( !inpath[v] )parse(n, v, p, inpath);
       // parse(n, v, p, inpath);
  }
}

void makeTree(int n, bool T[MAX][MAX], vector<int> p[MAX], int q){
  bool inpath[MAX];
  rep(i, n) inpath[i] = false;
  parse(n, n-1, p, inpath);

  rep(i, n) rep(j, n) T[i][j] = false;
  rep(v, n){
    rep(i, p[v].size()){
      int u = p[v][i];
      if ( inpath[u] && inpath[v] ) T[u][v] = true;
    }
  }

  vector<int> order;
  bool visited[MAX]; 

  rep(i, n) visited[i] = false;
  order.clear();
  tsort(n, 0, T, order, visited, p);
  reverse(order.begin(), order.end());

  double forward[MAX], back[MAX];
  rep(i, n) forward[i] = back[i] = 0.0;

  //rep(i,n) cout << order[i] << " ";
  //cout << endl;

  assert( order[0] == 0 );
  assert( order[order.size()-1] == n-1 );
  forward[order[0]] = 1;
  for ( int i = 0; i < order.size(); i++ ){
    int u = order[i];
    rep(v, n){
      if ( T[u][v] ) forward[v] += forward[u];
    }
  }
  for ( int i = 0; i < n; i++ ){
    if ( 0 == i ) continue;
    forward[i] /= forward[n-1];
  }
  
  rep(i, n) visited[i] = false;
  order.clear();
  // Tt
  bool tmp[MAX][MAX];
  /*
 rep(i, n){
    rep(j, n) cout << T[i][j] << " ";
    cout << endl;
    }*/
  rep(i, n) rep(j, n) tmp[j][i] = T[i][j];
  rep(i, n) rep(j, n) T[i][j] = tmp[i][j];

  /*
  rep(i, n){
    rep(j, n) cout << T[i][j] << " ";
    cout << endl;
  }
    cout << endl;
  */


  tsort(n, n-1, T, order, visited, p);
  reverse(order.begin(), order.end());

  //  rep(i, n) cout << order[i] << " ";
  //  cout << endl;

  assert( order[0] == n-1 );
  assert( order[order.size()-1] == 0 );
  back[order[0]] = 1.0;
  for ( int i = 0; i < order.size(); i++ ){
    int u = order[i];
    rep(v, n){
      if ( T[u][v] ) back[v] += back[u];
    }
  }

  double base = 1.0; // back[0];
  for ( int i = 0; i < n; i++ ){
    if ( i == n-1 ) continue;
    // back[i] = back[i]/back[0];
    back[i] = back[i]/base;

  }


  /*
  rep(i, n){
    //printf("%.4lf %.4lf %.4lf\n", forward[i], back[i], forward[i]*back[i]);
    printf("%.8lf\n", forward[i]*back[i]);
  }
  cout << endl;
  */

  int req;

  rep(i, q){
    cin >> req;
    assert( 0 < req && req < n-1 );
    printf("%.12lf\n", forward[req]*back[req]);
    
	//printf("%.12lf * %.2lf = %.12lf\n", forward[req], back[req], forward[req]*back[req]);
  }

  
  cout << endl;

}


int main(){
  int n, m, q, G[MAX][MAX], s, t, c;
  bool T[MAX][MAX];
  vector<int> p[MAX];
  while(1){
    cin >> n >> m >> q;
    if ( n == 0 && m == 0 && q == 0) break;

    rep(i, n) rep(j, n) G[i][j] = INFTY;
    rep(i, m){
      cin >> s >> t >> c;
      G[s][t] = G[t][s] = c;
    }
    dijkstra(n, G, p);
    makeTree(n, T, p, q);
  }
}