#include <bits/stdc++.h>
using namespace std;
struct cmp {
  bool operator()(const pair<int, string> a, const pair<int, string> b) {
    return a.first > b.first;
  }
};
int N = 1e5 + 5;
vector<int> special(N), ans(N);
unordered_map<int, bool> isSpecial;
unordered_map<int, bool> isIncluded;
priority_queue<pair<int, string>, vector<pair<int, string>>, cmp> pq;
void addEdge(int x, int y, int w) {
  pq.push(make_pair(w, to_string(x) + "*" + to_string(y)));
}
vector<int> recoverVertices(string str) {
  int n = str.length(), star;
  for (int i = 0; i < n; i++) {
    if (str[i] == '*') {
      star = i;
      break;
    }
  }
  vector<int> ans(2);
  ans[0] = stoi(str.substr(0, star));
  ans[1] = stoi(str.substr(star + 1));
  return ans;
}
vector<int> parent(N, -1);
int findDSU(int v) {
  if (parent[v] < 0) return v;
  parent[v] = findDSU(parent[v]);
  return parent[v];
}
bool DSUUtil(int x, int y, int k) {
  parent[y] += parent[x];
  parent[x] = y;
  special[y] += special[x];
  if (special[y] == k) return true;
  return false;
}
bool unionDSU(int v1, int v2, int k) {
  int p1 = findDSU(v1);
  int p2 = findDSU(v2);
  if (p1 == p2) return false;
  if (abs(parent[p1]) < abs(parent[p2]))
    return DSUUtil(p1, p2, k);
  else
    return DSUUtil(p2, p1, k);
}
void include(int p, int& spCount) {
  isIncluded[p] = true;
  spCount++;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 1; i <= k; i++) {
    int num;
    cin >> num;
    special[num] = 1;
  }
  for (int i = 1; i <= m; i++) {
    int x, y, w;
    cin >> x >> y >> w;
    addEdge(x, y, w);
  }
  int cnt = 1, spCount = 0;
  int maxEdgeWeight = 0;
  while (cnt <= n - 1) {
    int curEdgeWeight = pq.top().first;
    string str = pq.top().second;
    pq.pop();
    vector<int> vertexes = recoverVertices(str);
    int u = vertexes[0];
    int v = vertexes[1];
    int p1 = findDSU(u);
    int p2 = findDSU(v);
    if (p1 == p2) continue;
    cnt++;
    maxEdgeWeight = curEdgeWeight;
    if (unionDSU(u, v, k)) break;
  }
  for (int i = 1; i <= k; i++) cout << maxEdgeWeight << " ";
  return 0;
}
