#include <bits/stdc++.h>
using namespace std;
void doRoutine() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
}
struct edge {
  long long int a, b, w;
  edge() = default;
  edge(long long int a, long long int b, long long int w) {
    this->a = a;
    this->b = b;
    this->w = w;
  }
};
bool operator<(const edge& e1, const edge& e2) { return e1.w < e2.w; }
vector<long long int> sz, parent;
void build(long long int v) {
  sz[v] = 1;
  parent[v] = v;
}
long long int findParent(long long int v) {
  if (parent[v] == v) return v;
  return (parent[v] = findParent(parent[v]));
}
map<long long int, long long int> ok;
void merge(long long int a, long long int b) {
  a = findParent(a);
  b = findParent(b);
  if (ok[a]) {
    parent[b] = a;
  } else {
    parent[a] = b;
  }
}
signed main() {
  doRoutine();
  long long int n, m, k, t;
  cin >> n >> m >> k;
  parent.resize(n);
  sz.resize(n);
  for (long long int i = 0; i < k; i++) {
    cin >> t;
    ok[t - 1] = 1;
  }
  for (long long int i = 0; i < n; i++) {
    build(i);
  }
  vector<edge> e(m);
  for (long long int i = 0; i < m; i++) {
    cin >> e[i].a >> e[i].b >> e[i].w;
  }
  sort(e.begin(), e.end());
  t = k;
  for (long long int i = 0; i < m; i++) {
    long long int a = e[i].a - 1, b = e[i].b - 1;
    a = findParent(a);
    b = findParent(b);
    if (a == b) {
      continue;
    }
    if (ok[a] && ok[b]) t -= 1;
    if (t == 1) {
      for (long long int j = 0; j < k; j++) {
        cout << e[i].w << " ";
      }
      return cout << endl, 0;
    }
    merge(a, b);
  }
  return 0;
}
