import std.stdio;
import std.ascii;
import std.range;
import std.array;
import std.functional;
import std.algorithm;
import std.conv;
import std.container;
import std.math;
import std.numeric;
import std.string;
import std.c.string;
import std.random;
import std.regex;
import std.typecons;

struct Edge {
    int from, to, cost;
}

const INF = int.max / 4;

int N, M, P;
int[] C;
Edge[][] G;

bool input() {
    scanf("%d %d %d\n", &N, &M, &P);
    if (N == 0) return false;
    G.destroy;
    G = new Edge[][N];
    foreach (i; 0 .. M) {
        int a, b, cost;
        scanf("%d %d %d\n", &a, &b, &cost);
        G[a] ~= Edge(a, b, cost);
        G[b] ~= Edge(b, a, cost);
    }
    C = new int[P];
    foreach (i; 0 .. P) {
        scanf("%d\n", &C[i]);
    }
    return true;
}

int[] dijkstra() {
    struct S { int v, cost; }
    BinaryHeap!(Array!S, "a.cost > b.cost") PQ;
    PQ.insert(S(0, 0));
    auto D = new int[N]; D[] = INF; D[0] = 0;
    while (!PQ.empty) {
        auto s = PQ.front; PQ.removeFront;
        foreach (e; G[s.v]) {
            if (D[e.to] <= s.cost + e.cost) continue;
            D[e.to] = s.cost + e.cost;
            PQ.insert(S(e.to, D[e.to]));
        }
    }
    return D;
}

void solve() {
    struct S { int v, cost; }
    auto D = dijkstra;
    BinaryHeap!(Array!S, "a.cost < b.cost") Q;
    Q.insert(S(N - 1, D[N - 1]));
    auto X = new int[][](N, N); X[N - 1][N - 1] = 1;
    auto inQ = new bool[N];
    while (!Q.empty) {
        auto s = Q.front; Q.removeFront;
        inQ[s.v] = false;
        foreach (e; G[s.v]) {
            if (D[e.to] == D[s.v] - e.cost) {
                X[e.to][s.v] += X[s.v].reduce!"a + b";
                if (!inQ[e.to]) {
                    inQ[e.to] = true;
                    Q.insert(S(e.to, D[e.to]));
                }
            }
        }
    }
    //writeln(D);
    //foreach (L; X) writeln(L);

    BinaryHeap!(Array!S, "a.cost > b.cost") Qs;
    Qs.insert(S(0, 0));
    auto Prob = new real[N]; Prob[] = 0.0;
    Prob[0] = 1.0;
    inQ[] = false;
    while (!Qs.empty) {
        auto s = Qs.front; Qs.removeFront;
        inQ[s.v] = false;
        auto x = X[s.v].reduce!"a + b";
        foreach (e; G[s.v]) {
            if (X[s.v][e.to] == 0) continue;
            if (!inQ[e.to]) {
                assert(s.cost + e.cost == D[e.to]);
                Qs.insert(S(e.to, D[e.to]));
                inQ[e.to] = true;
            }
            Prob[e.to] += Prob[s.v] / x * X[s.v][e.to];
        }
    }

    foreach (c; C) {
        writefln("%.12f", Prob[c]);
    }
    writeln;
}

void main() {
    while (input) solve;
}