#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <cmath>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <map>
using namespace std;

#define mp make_pair
#define pb push_back

typedef double db;
const int maxn = 11111;
const db EPS = 1e-8;
int sign(db x){return x < - EPS ?  - 1 : x > EPS; }

int n, m;
db p[ maxn ][ 3 ];
vector< pair<int, pair<int,db>  > > E[ maxn ];
db d[ maxn ][ 2 ];
int v[ maxn ][ 2 ];
int Q[ 1 << 16 ][2];
#define sqr(x) ((x)*(x))
int s, t, di;

void add(int x, int y) {
	if(sign(p[x][2] - p[y][2]) >= 0) {
		db dis = sqrt(sqr(p[x][0]-p[y][0])+sqr(p[x][1]-p[y][1])+sqr(p[x][2]-p[y][2]));
		E[x].pb( mp(y, mp(0,dis)));
	}else {
		db dis = sqrt(sqr(p[x][0]-p[y][0])+sqr(p[x][1]-p[y][1]));
		int d = floor(100.0 * fabs(p[y][2]-p[x][2])/dis + 3 * EPS);
		db dd = sqrt(sqr(p[x][0]-p[y][0])+sqr(p[x][1]-p[y][1])+sqr(p[x][2]-p[y][2]));
		E[x].pb( mp(y, mp(d,dd)));
	}
}

void spfa(int n, int s, int t) {
	for(int i = 0; i < n; ++ i) v[i][0] = v[i][1] = 0, d[i][0]=d[i][1]=1e10;
	d[s][0]=0.0;
	int l,r;
	Q[l=r=0][0]=s; Q[0][1]=0; ++ r;
	while(l^r) {
		int x = Q[l][0];
		int c = Q[l][1];
		++ l;
		l &= 0xffff; v[x][c]=0;
		for(int i = 0; i < E[x].size();++i) {
			int y = E[x][i].first;
			int dd =E[x][i].second.first;
			db dis = E[x][i].second.second;
			if(dd > di) continue;
			int nxt = c?1:(dd == di);
			if(d[y][nxt] > d[x][c] + dis) {
				d[y][nxt]=d[x][c]+dis;
				if(!v[y][nxt]) {
					v[y][nxt]=1;
					Q[r][0]=y; Q[r][1]=nxt; ++ r; r &= 0xffff;
				}
			}
		}
	}
}

int main() {
	while(cin>>n>>m,n||m) {
		for(int i=0;i<n;++i) E[i].clear();
		for(int i = 0; i < n; ++ i) {
			 scanf("%lf%lf%lf", &p[i][0], &p[i][1], &p[i][2]);
		}
		while(m--){
			int a,b;
			scanf("%d%d", &a, &b);
			-- a; -- b;
			add(a,b);
			add(b,a);
		}
		scanf("%d%d%d", &s, &t, &di);
		--s; -- t;
		spfa(n,s,t);
		if(s!=t) {
			db ans = d[t][1];
			if(ans > 1e9) puts("None");
			else printf("%.3f\n", ans);
		}else {
			db ans = 1e10;
			for(int i=0;i<n;++i) if(i!=s)
				for(int j=0;j<E[i].size();++j){
					int y = E[i][j].first ;
					int dd = E[i][j].second.first;
					db dis = E[i][j].second.second;
					if(y != s || di < dd) continue;
					ans = min( ans, d[i][1]+dis);
					if(dd == di) {
						ans = min(ans, min(d[i][1] , d[i][0]) + dis);
					}
				}
			if(ans > 1e9) puts("None");
			else printf("%.3f\n", ans);
		}
	}
	return 0;
}
