#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > gr[100002];
int n, m, k;
int sv[100002];
bool sp[100002];
bool v[100002];
int nr;
void dfs(int u, int mx) {
  if (sp[u]) nr++;
  v[u] = 1;
  for (auto e : gr[u])
    if (!v[e.first] && e.second <= mx) dfs(e.first, mx);
}
int main() {
  cin >> n >> m >> k;
  int mxc = -1;
  for (int i = 1; i <= k; i++) {
    cin >> sv[i];
    sp[sv[i]] = 1;
  }
  for (int i = 1; i <= m; i++) {
    int u, v, c;
    cin >> u >> v >> c;
    gr[u].push_back({v, c});
    gr[v].push_back({u, c});
    mxc = max(mxc, c);
  }
  int l = 1, r = mxc, mid;
  while (l < r) {
    mid = (l + r) / 2;
    memset(v, 0, sizeof(v));
    nr = 0;
    dfs(sv[1], mid);
    if (nr < k)
      l = mid + 1;
    else
      r = mid;
  }
  for (int i = 1; i <= k; i++) cout << l << " ";
  return 0;
}
