#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 1;
int p[maxn], w[maxn];
int pa(int x) { return x == p[x] ? x : p[x] = pa(p[x]); }
void merge(int x, int y) {
  x = pa(x);
  y = pa(y);
  if (x != y) {
    p[x] = y;
    w[y] += w[x];
  }
}
int n, k, m;
struct Edge {
  int u, v, w;
  void read() { scanf("%d %d %d", &u, &v, &w); }
  bool operator<(const Edge &r) const { return w < r.w; }
} e[maxn];
int main() {
  scanf("%d %d %d", &n, &m, &k);
  for (int i = 1; i <= n; ++i) p[i] = i, w[i] = 0;
  int special;
  for (int i = 1; i <= k; ++i) {
    int &x = special;
    scanf("%d", &x);
    w[x] = 1;
  }
  for (int i = 1; i <= m; ++i) e[i].read();
  sort(e + 1, e + 1 + m);
  for (int i = 1; i <= m; ++i) {
    merge(e[i].u, e[i].v);
    if (w[pa(special)] == k) {
      int ans = e[i].w;
      for (int i = 1; i <= k; ++i) printf("%d%c", ans, " \n"[i == k]);
      return 0;
    }
  }
}
