A city is served by several fire stations. Some residents complain that the nearest station is too far from their homes, so the city will build one additional fire station. Choose where to build it so that the residents are as close as possible to their nearest station.
The city has at most $500$ intersections joined by two-way road segments of various positive lengths. At most $20$ road segments meet at any intersection. Every house and every fire station sits at an intersection (the short walk from the intersection to the actual building is ignored), and every intersection has at least one house. An intersection may hold more than one fire station.
The first line contains two positive integers $f$ and $i$: the number of existing fire stations ($f \le 100$) and the number of intersections ($i \le 500$). Intersections are numbered $1$ through $i$.
The next $f$ lines each contain the intersection number of one existing fire station.
Each remaining line contains three positive integers $a$, $b$, and $d$: a road segment of length $d$ connecting two distinct intersections $a$ and $b$. Every segment is two-way, and a route exists between every pair of intersections.
Print a single integer: the lowest-numbered intersection at which to build the new fire station so that the maximum, over all intersections, of the distance from that intersection to its nearest fire station is as small as possible.