#include <bits/stdc++.h>
using std::abs;
using std::bitset;
using std::cerr;
using std::cin;
using std::cout;
using std::map;
using std::max;
using std::min;
using std::pair;
using std::set;
using std::sort;
using std::string;
using std::swap;
using std::unordered_map;
using std::unordered_set;
using std::vector;
using ll = long long;
using uint = unsigned int;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using ull = unsigned long long;
using ld = long double;
using vci = vector<int>;
using vcl = vector<ll>;
template <typename T>
void _dbg(const char* _s, T _h) {
  cerr << _s << " = " << _h << "\n";
}
template <typename T, typename... Ts>
void _dbg(const char* _s, T _h, Ts... _t) {
  int _b = 0;
  while (((_b += *_s == '(') -= *_s == ')') != 0 || *_s != ',') cerr << *_s++;
  cerr << " = " << _h << ",";
  _dbg(_s + 1, _t...);
}
struct init {
  init() {
    cin.tie(0);
    std::iostream::sync_with_stdio(0);
    cout << std::fixed << std::setprecision(10);
    cerr << std::fixed << std::setprecision(5);
  }
  ~init() {}
} init;
template <typename T, typename U>
void upx(T& x, U y) {
  if (x < y) x = y;
}
template <typename T, typename U>
void upn(T& x, U y) {
  if (x > y) x = y;
}
const ll N = 1e5 + 1;
struct edge {
  ll a, b, c;
} es[N];
ll p[N], rank[N], cnt[N];
ll get(ll x) { return x == p[x] ? x : (p[x] = get(p[x])); }
bool un(ll x, ll y) {
  if ((x = get(x)) == (y = get(y))) return 0;
  if (rank[x] < rank[y]) swap(x, y);
  p[y] = x;
  if (rank[x] == rank[y]) rank[x]++;
  cnt[x] += cnt[y];
  return 1;
}
int32_t main() {
  ll n, m, k;
  cin >> n >> m >> k;
  for (ll i = 0; i < k; ++i) {
    ll x;
    cin >> x;
    cnt[x] = 1;
  }
  for (ll i = 0; i < m; ++i) cin >> es[i].a >> es[i].b >> es[i].c;
  sort(es, es + m, [](const edge& p1, const edge& p2) { return p1.c < p2.c; });
  for (ll i = 1; i <= n; ++i) {
    p[i] = i;
  }
  for (ll i = 0; i < m; ++i) {
    ;
    if (un(es[i].a, es[i].b)) {
      if (cnt[get(es[i].a)] == k) {
        for (ll j = 0; j < k; ++j) cout << es[i].c << ' ';
        cout << '\n';
        return 0;
      }
    }
  }
  return 0;
}
