def calc(a, b, c)
  a,b = b,a if a > b
  (c-(b-a)+1)/2 + b
end
n, m, k = gets.split.map(&:to_i)
l = Array.new(n, 1<<31)
t = m.times.map{ gets.split.map(&:to_i) }
m.times{ |i| t[i][0] -= 1; t[i][1] -= 1 }
k.times{ l[gets.to_i-1] = 0 }
n.times do
  for a in (0...m)
    for b in (0...2)
      l[t[a][b]] = [l[t[a][b]], l[t[a][1-b]] + t[a][2]].min
    end
  end
end
p m.times.map{ |i| calc(l[t[i][0]], l[t[i][1]], t[i][2]) }.max