#include <bits/stdc++.h>
using namespace std;
int const size = (1e5 + 7) * 2;
int dj[size];
int djsize[size];
int u, v, w;
void djinit() {
  for (int x = 0; x < size; x++) dj[x] = x;
  for (int x = 0; x < size; x++) djsize[x] = 1;
}
int find(int i) {
  if (dj[i] == i) return i;
  dj[i] = find(dj[i]);
  return dj[i];
}
void djunion(int i, int j) {
  int root1 = find(i);
  int root2 = find(j);
  if (root1 != root2) {
    if (djsize[root1] < djsize[root2]) {
      djsize[root2] += djsize[root1];
      dj[root1] = dj[root2];
    } else {
      djsize[root1] += djsize[root2];
      dj[root2] = dj[root1];
    }
  }
}
bool a[size];
struct node {
  int u;
  int v;
  int w;
};
node make_node(int u, int v, int w) {
  node n;
  n.u = u;
  n.v = v;
  n.w = w;
  return n;
}
vector<node> mst;
vector<int> graph[size];
bool cmp(node a, node b) { return a.w < b.w; }
int main() {
  int n, m, k;
  scanf("%d %d %d", &n, &m, &k);
  djinit();
  for (int x = 0, i; x < k; x++) {
    cin >> i;
    a[i] = true;
  }
  for (int x = 0; x < m; x++) {
    cin >> u >> v >> w;
    mst.push_back(make_node(u, v, w));
  }
  sort(mst.begin(), mst.end(), cmp);
  int b = k;
  for (int x = 0; x < m; x++) {
    int u = find(mst[x].u);
    int v = find(mst[x].v);
    if (u != v) {
      if (a[u])
        dj[v] = u;
      else
        dj[u] = v;
      if (a[u] && a[v]) b--;
      if (b == 1) {
        for (int i = 0; i < k; i++) cout << mst[x].w << " ";
        return 0;
      }
    }
  }
  return 0;
}
