#include <bits/stdc++.h>
using namespace std;
const int INF = 0x7f7f7f7f;
int n, m, s, t, p, c, d, x[505], y[505];
int mxf, mnc;
int ee = 1, h[5000005], nex[5000005 << 1], to[5000005 << 1], val[5000005 << 1],
    cost[5000005 << 1];
int dis[5000005], pre[5000005], last[5000005], flow[5000005];
bool vis[5000005];
void addedge(int x, int y, int z, int c) {
  nex[++ee] = h[x];
  to[ee] = y;
  val[ee] = z;
  cost[ee] = c;
  h[x] = ee;
}
bool spfa() {
  memset(dis, INF, sizeof(dis));
  memset(vis, false, sizeof(vis));
  queue<int> q;
  q.push(s);
  vis[s] = true;
  dis[s] = 0;
  flow[s] = INF;
  pre[t] = -1;
  while (!q.empty()) {
    int x = q.front();
    q.pop();
    vis[x] = false;
    for (int i = h[x]; i; i = nex[i])
      if (val[i] && dis[to[i]] > dis[x] + cost[i]) {
        dis[to[i]] = dis[x] + cost[i];
        pre[to[i]] = x;
        last[to[i]] = i;
        flow[to[i]] = min(flow[x], val[i]);
        if (!vis[to[i]]) {
          vis[to[i]] = true;
          q.push(to[i]);
        }
      }
  }
  return pre[t] != -1;
}
void mcmf() {
  mxf = mnc = 0;
  while (spfa()) {
    int now = t;
    mxf += flow[t];
    mnc += flow[t] * dis[t];
    while (now != s) {
      val[last[now]] -= flow[t];
      val[last[now] ^ 1] += flow[t];
      now = pre[now];
    }
  }
}
int zh(int t, int x) { return t * n + x; }
int main() {
  cin >> n >> m >> p >> c >> d;
  s = 0, t = n * 99 + 1;
  for (int i = 1, x; i <= p && cin >> x; i++)
    addedge(s, zh(0, x), 1, 0), addedge(zh(0, x), s, 0, 0);
  for (int i = 1; i <= m; cin >> x[i] >> y[i], i++)
    ;
  for (int i = 0; i <= 99; i++) {
    addedge(zh(i, 1), zh(i + 1, 1), INF, 0),
        addedge(zh(i + 1, 1), zh(i, 1), 0, 0);
    for (int j = 2; j <= n; j++)
      addedge(zh(i, j), zh(i + 1, j), INF, c),
          addedge(zh(i + 1, j), zh(i, j), 0, -c);
    for (int j = 1; j <= m; j++)
      for (int k = 1; k <= p; k++) {
        int cst = d * k * k - d * (k - 1) * (k - 1) + c;
        addedge(zh(i, x[j]), zh(i + 1, y[j]), 1, cst),
            addedge(zh(i + 1, y[j]), zh(i, x[j]), 0, -cst);
        addedge(zh(i, y[j]), zh(i + 1, x[j]), 1, cst),
            addedge(zh(i + 1, x[j]), zh(i, y[j]), 0, -cst);
      }
  }
  mcmf();
  cout << mnc << endl;
  return 0;
}
