#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 7;
int n, m, k, x[maxn], tot, fa[maxn], ans, no[maxn];
struct node {
  int u, v, w;
  bool operator<(const node &rhs) const { return w > rhs.w; }
};
priority_queue<node> Q;
inline int find(int x) { return x == fa[x] ? x : fa[x] = find(fa[x]); }
void merge(const node &t) {
  int x = find(t.u), y = find(t.v);
  if (x == y) return;
  tot--;
  if (no[x] && no[y]) ans = max(ans, t.w);
  if (no[x]) no[y] = 1;
  fa[x] = y;
}
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= k; ++i) scanf("%d", &x[i]), no[x[i]] = 1;
  for (int i = 1, u, v, w; i <= m; ++i)
    scanf("%d%d%d", &u, &v, &w), Q.push({u, v, w});
  for (int i = 1; i <= n; ++i) fa[i] = i;
  tot = n;
  while (tot > 1) merge(Q.top()), Q.pop();
  for (int i = 1; i <= k; ++i) printf("%d ", ans);
}
