Types: n: int, m: int, p: int, edges: List[Tuple[int, int, int]], c: List[int]
Ranges: 3 ≤ n ≤ 100, 1 ≤ m ≤ n*(n-1)/2, 1 ≤ p ≤ n, 0 ≤ node ≤ n-1, 1 ≤ weight < 10000
Addtl Info: Input terminates when n = m = p = 0. There are no parallel edges and no edge with identical endpoints.