{"trustable":false,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003e小H正在玩一款恋爱养成游戏,黑魂\u003c/p\u003e\n\u003cp\u003e现在他手里有一张王城地图,里面有n个关键点,他们之间有m条道路(无向连通图),不过众所周知,这款游戏的开发者是不会好好设计地图的,所以地图存在重边和自环,但是没关系!我们定义只有某路径属于两点间的最短路径时,他才是有效的。\u003c/p\u003e\n\u003cp\u003en个点中,有k个点站着不死人(不要问我为什么这么多,问就是批发),小H想知道,对于每个不死人来说,只经过有效路径,要走到另一个不死人最远需要多远?\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line contains three integers n, m and k (2 \u003c\u003d k \u003c\u003d n \u003c\u003d 10^5, n-1 \u003c\u003d m \u003c\u003d 10^5)\u003c/p\u003e\n\u003cp\u003eThe second line contains k distinct integers x_1, x_2,.........(1\u003c\u003d x_i \u003c\u003d n).\u003c/p\u003e\n\u003cp\u003eEach of the following m lines contains three integers u, v and w (1\u003c\u003d w \u003c\u003d10^9)\u003c/p\u003e\n\u003cp\u003eThe graph may have multiple edges and self-loops.\u003c/p\u003e\n\u003cp\u003eIt is guaranteed, that the graph is connected.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eThe first and only line should contain k integers. The i-th integer is the distance between x_i and the farthest special vertex from it.\u003c/p\u003e"}},{"title":"Examples","value":{"format":"HTML","content":"\u003cdiv class\u003d\"sample-test\"\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \u003cpre\u003e2 3 2\u003cbr\u003e2 1\u003cbr\u003e1 2 3\u003cbr\u003e1 2 2\u003cbr\u003e2 2 1\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e\n \u003cpre\u003e2 2 \u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \u003cpre\u003e4 5 3\u003cbr\u003e1 2 3\u003cbr\u003e1 2 5\u003cbr\u003e4 2 1\u003cbr\u003e2 3 2\u003cbr\u003e1 4 4\u003cbr\u003e1 3 3\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e\n \u003cpre\u003e3 3 3 \u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n\u003c/div\u003e"}},{"title":"Note","value":{"format":"HTML","content":""}}]}