{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003ePony is the boss of a courier company. The company needs to deliver packages to $n$ offices numbered from $1$ to $n$. Especially, the $s$-th office is the transfer station of the courier company.\u003c/p\u003e\n\u003cp\u003eThere are $x$ ordinary two-way roads and $y$ one-way roads between these offices. The delivery vans will consume $c_i$ power if they pass through the $i$-th road. In general, the power consumption on one road must be non-negative. However, thanks to the experimental charging rail, the consumption may be negative on some one-way roads.\u003c/p\u003e\n\u003cp\u003eBesides, Pony got the following public information. The relevant department promised that if there is a one-way street from $a_i$ to $b_i$, it is impossible to return from $b_i$ to $a_i$.\u003c/p\u003e\n\u003cp\u003eTo avoid the delivery vans anchoring on the road, Xiaodao wants to find these lowest power consumptions from the transfer station to these offices.\u003c/p\u003e\n\u003ch3\u003eInput\u003c/h3\u003e\n\u003cp\u003eThe first line contains four integers $n~(1 \\le n \\le 25000), x, y~(1 \\le x, y \\le 50000)$, and $s~(1 \\le s \\le n)$. This is followed by $x+y$ lines, each line of which contains three integer $a_i, b_i~(1 \\le a_i, b_i \\le n, a_i \\neq b_i)$ and $c_i~(-10000 \\le c_i \\le 10000)$ describing the roads. The first $x$ given roads are ordinary two-way roads, and the last $y$ given roads are one-way roads.\u003c/p\u003e\n\u003ch3\u003eOutput\u003c/h3\u003e\n\u003cp\u003eThe output should contain $n$ lines, the $i$-th line represents the minimum energy consumption from $s$-th to the $i$-th office if possible, or output \u003ccode\u003eNO PATH\u003c/code\u003e if it is impossible to reach the $i$-th office.\u003c/p\u003e"}},{"title":"Sample 1","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e6 3 3 4\n1 2 5 \n3 4 5\n5 6 10\n3 5 -100 \n4 6 -100 \n1 3 -10\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eNO PATH\nNO PATH\n5\n0\n-95 \n-100\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003cbr /\u003e"}}]}