#!/usr/bin/env python
# ACM-SP Problem D: Bycycle Training Routes  <mjd@cs.auckland.ac.nz>

def intVec(s): return map(int, s.readline().strip().split())

import networkx as nx, numpy as np
from sys import stdin 
from math import sqrt

x=np.zeros(10000,int)
y=np.zeros(10000,int)
z=np.zeros(10000,int)

def horizontaldist(i,j):
  return sqrt((x[i]-x[j])**2+(y[i]-y[j])**2)

def actualdist(i,j):
  return sqrt((x[i]-x[j])**2+(y[i]-y[j])**2+(z[i]-z[j])**2)

def grade(i,j,hd):
  return max(int(100*(z[j]-z[i])/hd),0)
  
while True:
  n,m=intVec(stdin)
  if n==0: break

  g=nx.DiGraph()
  g.add_nodes_from(range(n))

  for i in range(n):  # read vertex coordinates
     x[i],y[i],z[i]=intVec(stdin)
  for j in range(m):  # read edges (add as directed with grades)
     u,v=intVec(stdin)
     u1,v1=u-1,v-1
     hd=horizontaldist(u1,v1)
     dist=actualdist(u1,v1)
     if z[u1]<=z[v1]:
       g.add_edge(u1,v1,{'dist': dist, 'grade': grade(u1,v1,hd)})
       g.add_edge(v1,u1,{'dist': dist, 'grade': 0})
     else:
       g.add_edge(v1,u1,{'dist': dist, 'grade': grade(v1,u1,hd)})
       g.add_edge(u1,v1,{'dist': dist, 'grade': 0})
  s,t,d=intVec(stdin)
  s,t=s-1,t-1
  gF=nx.DiGraph()  # filtered with only roads of grade <= d
  gF.add_nodes_from(range(n))
  gB=nx.DiGraph()  # filtered with only roads of grade <= d
  gB.add_nodes_from(range(n))
  for (u,v,attr_dict) in g.edges(data=True):
     dist,gd=attr_dict['dist'],attr_dict['grade']
     if gd<=d: 
         gF.add_edge(u,v,weight=dist)
         gB.add_edge(v,u,weight=dist)
  b_dist=n*10000 # worst case (i.e. None)
  len_s=nx.single_source_dijkstra_path_length(gF,s)
  len_t=nx.single_source_dijkstra_path_length(gB,t)
  for (u,v,attr_dict) in g.edges(data=True):
     dist,gd=attr_dict['dist'],attr_dict['grade']
     if gd==d and u in len_s and v in len_t and len_s[u]+len_t[v]+dist<b_dist:
        b_dist=len_s[u]+len_t[v]+dist
  if b_dist<n*10000:
    print '%0.3f' % b_dist
  else:
    print None

