#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 50;
int n, m, k, x, y;
struct node {
  int x, y, z;
  bool operator<(const node &o) const { return z < o.z; }
} b[N];
int fa[N], a[N], ans;
int gf(int u) { return fa[u] == u ? u : fa[u] = gf(fa[u]); }
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= k; i++) {
    scanf("%d", &x);
    a[x] = 1;
  }
  for (int i = 1; i <= n; i++) fa[i] = i;
  for (int i = 1; i <= m; i++) scanf("%d%d%d", &b[i].x, &b[i].y, &b[i].z);
  sort(b + 1, b + m + 1);
  for (int i = 1; i <= m; i++) {
    x = gf(b[i].x);
    y = gf(b[i].y);
    if (x == y) continue;
    fa[x] = y;
    if (a[x] && a[y]) ans = b[i].z;
    if (a[x]) a[y] |= 1;
  }
  for (int i = 1; i <= k; i++) printf("%d ", ans);
}
