n,m=map(int,input().split()) S,G=map(int,input().split()) S-=1 G-=1 p=[tuple(map(int,input().split())) for i in range(n)] e=[] for i in range(m): s,g=map(int,input().split()) s-=1 g-=1 sx,sy=p[s] gx,gy=p[g] d=((sx-gx)**2+(sy-gy)**2)**0.5 e[s]+=[(g,d)] e[g]+=[(s,d)] from heapq import heappush,heappop v=[X]*n v[S]=0 q=[(v[S],S)] while len(q)>0: sc,sp=heappop(q) if sc>v[sp]: continue for tp,tc in e[sp]: if v[tp]>sc+tc: v[tp]=sc+tc heappush(q,(v[tp],tp)) print(v[G])