#include <bits/stdc++.h>
using namespace std;
#define ll long long
ll k, dp[262144][18], ok[18][18];
ll solve(ll m, ll e){
	if (dp[m][e] != 0) return dp[m][e];
	if ((m ^ (1ll << e)) == 0) return dp[m][e] = 1;
	dp[m][e] = 1e18;
	for (ll i = 0; i < k; i++){
		if (ok[i][e] != -1 && m & (1 << i)) dp[m][e] = min(dp[m][e], solve(m & ~(1ll << e), i) + ok[i][e]);
	}
	return dp[m][e];
}
int main(){
	ll n, m, ans = 1e18;
	scanf("%ld %lld", &n, &m);
	ll a[m], b[m];
	vector<ll> ad[n];
	for (ll i = 0; i < m; i++){
		scanf("%lld %lld", &a[i], &b[i]), a[i]--, b[i]--;
		ad[a[i]].emplace_back(b[i]);
		ad[b[i]].emplace_back(a[i]);
	}
	scanf("%lld", &k);
	ll c[k];
	for (ll i = 0; i < k; i++) scanf("%lld", &c[i]), c[i]--;
	for (ll i = 0; i < k; i++){
		queue<ll> q;
		q.push(c[i]);
		ll d[n];
		fill(d, d + n, -1);
		d[c[i]] = 0;
		while (!q.empty()){
			ll f = q.front();
			q.pop();
			for (ll e : ad[f]){
				if (d[e] == -1){
					d[e] = d[f] + 1;
					q.push(e);
				}
			}
		}
		for (ll j = 0; j < k; j++) if (i != j) ok[i][j] = d[c[j]];
	}
	for (ll i = 0; i <= k; i++) ans = min(ans, solve((1ll << k) - 1, i));
	if (ans == 1e18) ans = -1;
	printf("%lld\n", ans);
}
#include <bits/stdc++.h>          
using namespace std;
using ll = long long;
using ld = long double;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repp(i, st, en) for (ll i = (ll)st; i < (ll)(en); i++)
#define repm(i, st, en) for (ll i = (ll)st; i >= (ll)(en); i--)
#define all(v) v.begin(), v.end()
void chmax(ll &x, ll y) {x = max(x,y);}
void chmin(ll &x, ll y) {x = min(x,y);}
void Yes() {cout << "Yes" << endl; exit(0);}
void No() {cout << "No" << endl; exit(0);}
template<class in_Cout> void Cout(in_Cout x) {cout << x << endl; exit(0);}
template<class in_vec_cout>
void vec_cout(vector<in_vec_cout> vec) {
    for (in_vec_cout res : vec) {cout << res << " ";}
    cout << endl;
}

const ll inf = 1e18;
const ll mod = 1e9 + 7;

ll N;
vector<pair<ld,ld>> P;
ld dist[110][110];

map<ld,bool> rad;

void init() {
    cin >> N;
    rep(i,N) {
        ld x, y; cin >> x >> y;
        P.push_back({x,y});
    }
    rep(i,N) {
        rep(j,N) {
            if (i==j) continue;
            ld from_x = P[i].first, from_y = P[i].second;
            ld to_x = P[j].first, to_y = P[j].second;
            ld dx = to_x - from_x, dy = to_y - from_y;
            dist[i][j] = sqrt(dx*dx+dy*dy);
        }
        dist[i][N] = dist[N][i] = (ld)100 - P[i].second;
        dist[i][N+1] = dist[N+1][i] = P[i].second + (ld)100;
    }
    dist[N][N+1] = dist[N+1][N] = 200.0;
    rep(i,N+2) rep(j,N+2) {
        rad[dist[i][j]*0.5] = true;
    }
    rad[100.0] = true;
}

bool judge(ld r) {
    ld d = (ld)2*r;
    vector<vector<ll>> G(N+2);
    rep(i,N+2) rep(j,N+2) {
        if (dist[i][j]>=d) continue;
        G[i].push_back(j);
    }
    queue<ll> que;
    que.push(N);
    vector<bool> seen(N+2);
    seen[N] = true;
    while (que.size()) {
        ll x = que.front();
        que.pop();
        for (ll y : G[x]) {
            if (seen[y]) continue;
            seen[y] = true;
            que.push(y);
        }
    }
    return seen[N+1];
}

void solve() {
    init();
    ld ans = 0.0;
    for (auto p : rad) {
        ld r = p.first;
        bool NG = judge(r);
        if (NG) break;
        ans = r;
    }
    cout << fixed << setprecision(10);
    cout << ans << endl;
}

int main() {
    solve();
}