There are $N$ farms ($1 \le N \le 1000$), numbered $1$ through $N$. From each farm, exactly one cow travels to a big cow party held at farm $X$ ($1 \le X \le N$). The farms are connected by $M$ bidirectional roads ($1 \le M \le 100{,}000$); it is always possible to travel between any two farms along the roads. Traversing road $i$ takes $T_i$ ($1 \le T_i \le 100$) units of time. Two farms may be directly connected by more than one road.
After every cow has gathered at farm $X$, they realize that each of them left her party favors back home. They pause the party and send every cow home to fetch her favors and then return to farm $X$. Each cow walks the fastest possible route to her home farm and back. The party stays paused until the last cow returns, so its suspension time equals the largest round-trip time among all the cows. What is this minimum suspension time?
The first line contains three space-separated integers $N$, $M$, and $X$.
Each of the next $M$ lines describes one road with three space-separated integers $A_i$, $B_i$, and $T_i$: road $i$ connects farms $A_i$ and $B_i$ and takes $T_i$ units of time to traverse.
Print one integer: the minimum amount of time the party must be suspended.
Because the roads are bidirectional, a cow's round trip to farm $X$ and back takes exactly twice the shortest distance between her farm and farm $X$. So compute the shortest distance from farm $X$ to every farm with a single shortest-path search, then double the largest of those distances.