#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 200025;
int vis[MAX_N];
int fa[MAX_N], eid = 0;
struct node {
  int u, v, len;
  bool operator<(const node other) const { return len < other.len; }
} e[MAX_N], arr[MAX_N];
int get(int x) {
  if (fa[x] == x) return x;
  return fa[x] = get(fa[x]);
}
void Merge(int x, int y) {
  x = get(x), y = get(y);
  if (x != y) {
    fa[x] = y;
  }
}
int main() {
  int n, m, k, a, k_;
  scanf("%d%d%d", &n, &m, &k);
  k_ = k;
  for (int i = 1; i <= k; ++i) {
    scanf("%d", &a);
    vis[a] = true;
  }
  for (int i = 1; i <= m; ++i) {
    scanf("%d%d%d", &arr[i].u, &arr[i].v, &arr[i].len);
    if (arr[i].u == arr[i].v) continue;
    e[eid].u = arr[i].u;
    e[eid].v = arr[i].v;
    e[eid++].len = arr[i].len;
  }
  for (int i = 1; i <= n; ++i) fa[i] = i;
  sort(e, e + eid);
  int mst = n, ans = -1;
  for (int i = 0; i < eid; i++) {
    int x = get(e[i].u), y = get(e[i].v);
    if (x == y) {
      continue;
    } else {
      vis[y] += vis[x];
      Merge(x, y);
      ans = e[i].len;
      if (vis[y] == k) break;
    }
  }
  for (int i = 1; i <= k_; ++i)
    i == k_ ? printf("%d\n", ans) : printf("%d ", ans);
  return 0;
}
