import sys, heapq as hq readline = sys.stdin.readline ns = lambda: readline().rstrip() ni = lambda: int(readline().rstrip()) nm = lambda: map(int, readline().split()) nl = lambda: list(map(int, readline().split())) def k_shortestPath(G, s, t, k): N = len(G) d = [10**18]*N d[t] = 0 p = [-1]*N q = [(0, t, t)] ret = list() while q: wei, src, dst = hq.heappop(q) if p[dst] >= 0: continue p[dst] = src for fdst, fwei in G[dst]: if d[fdst] > wei + fwei: d[fdst] = wei + fwei hq.heappush(q, (d[fdst], dst, fdst)) l = 0 R = [(0, -1, s)] while R: wei, src, dst = hq.heappop(R) if dst == t: ret.append(wei + d[s]) l += 1 if l == k: return ret for fdst, fwei in G[dst]: hq.heappush(R, (wei + fwei - d[dst] + d[fdst], dst, fdst)) return None def solve(): n, m, k = nm() X, Y = nm() X -= 1; Y -= 1 points = [tuple(nm()) for _ in range(n)] G = [list() for _ in range(n)] for _ in range(m): u, v = nm() u -= 1; v -= 1 p, q = points[u] r, s = points[v] c = ((p - r)**2 + (q - s)**2) ** .5 G[u].append((v, c)) G[v].append((u, c)) res = k_shortestPath(G, X, Y, k) print(*res, sep='\n') return solve()