#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<map>
#include<set>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<sstream>
#include<numeric>
#include<cassert>

#define f first
#define s second
#define mp make_pair

#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define rep(i,s,n) for(int i=(s); i<(int)(n); i++)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)
#define ALL(c) (c).begin(), (c).end()
#define IN(x,s,g) ((x) >= (s) && (x) < (g))
#define ISIN(x,y,w,h) (IN((x),0,(w)) && IN((y),0,(h)))
#define print(x) printf("%d\n",x)

using namespace std;

typedef unsigned int uint;
typedef long long ll;

const int _dx[] = {0,1,0,-1};
const int _dy[] = {-1,0,1,0};

int getInt(){
  int ret = 0,c;
  c = getchar();
  while(!isdigit(c)) c = getchar();
  while(isdigit(c)){
    ret *= 10;
    ret += c - '0';
    c = getchar();
  }
  return ret;
}

int g[100][100];
int h[100][100];
int c[100];
double r[100][100];

int main(){
  while(true){
    int n = getInt();
    int m = getInt();
    int p = getInt();

    if(n+m+p == 0) break;

#define MAX 10000000
    REP(i,n) REP(j,n){
      g[i][j] = 0;
      h[i][j] = (i == j ? 0 : MAX);
    }

    REP(i,m){
      int a = getInt();
      int b = getInt();
      int c = getInt();

      h[a][b] = h[b][a] = g[a][b] = g[b][a] = c;
    }

    REP(i,p) c[i] = getInt();

    REP(k,n) REP(i,n) REP(j,n){
      h[i][j] = min(h[i][j], h[i][k] + h[k][j]);
    }

    REP(i,n) REP(j,n){
      if(g[i][j] == 0)
        r[i][j] = 0.0;
      else if(h[0][i] + g[i][j] + h[j][n-1] != h[0][n-1])
        r[i][j] = 0.0;
      else
        r[i][j] = 1.0;
    }

    REP(k,n) REP(i,n) REP(j,n){
      r[i][j] = r[i][j] + r[i][k] * r[k][j];
    }

    REP(i,p)
      printf("%.8f\n",r[0][c[i]]*r[c[i]][n-1]/r[0][n-1]);
    puts("");
  }
  return 0;
}