from heapq import heapify, heappush as hpush, heappop as hpop from math import sqrt import sys input = lambda: sys.stdin.readline().rstrip() N, M = map(int, input().split()) s, t = map(int, input().split()) s, t = s-1, t-1 L = [] for _ in range(N): a, b = map(int, input().split()) L.append((a, b)) X = [[] for _ in range(N)] for _ in range(M): a, b = map(int, input().split()) a, b = a-1, b-1 d = sqrt((L[a][0] - L[b][0]) ** 2 + (L[a][1] - L[b][1]) ** 2) X[a].append([b, d]) X[b].append([a, d]) def dijkstra(n, E, i0=0): h = [[0, i0]] D = [-1] * n done = [0] * n D[i0] = 0 while h: d, i = hpop(h) done[i] = 1 for j, w in E[i]: nd = d + w if D[j] < 0 or D[j] > nd: if done[j] == 0: hpush(h, [nd, j]) D[j] = nd return D print(dijkstra(N, X, s)[t])