#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr int MAXN = 112345;
int p[MAXN], cs[MAXN];
tuple<int, int, int> es[MAXN];
int n, m, k;
int find(int x) {
  if (p[x] != x) p[x] = find(p[x]);
  return p[x];
}
int join(int x, int y) {
  int px = find(x);
  int py = find(y);
  if (px == py) return px;
  cs[px] += cs[py];
  p[py] = px;
  return px;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m >> k;
  for (int i = 0; i < n; i++) p[i] = i;
  for (int i = 0; i < k; i++) {
    int s;
    cin >> s;
    cs[s - 1]++;
  }
  for (int i = 0; i < m; i++) {
    int u, v, w;
    cin >> u >> v >> w;
    u--;
    v--;
    es[i] = tie(w, u, v);
  }
  sort(es, es + m);
  for (int i = 0; i < m; i++) {
    int u, v, w;
    tie(w, u, v) = es[i];
    int x = join(u, v);
    if (cs[x] == k) {
      for (int j = 0; j < k; j++) cout << w << ' ';
      cout << endl;
      break;
    }
  }
}
