#include <bits/stdc++.h>
using namespace std;
template <class T>
void _R(T &x) {
  cin >> x;
}
void _R(int &x) { scanf("%d", &x); }
void _R(long long &x) { scanf("%lld", &x); }
void _R(double &x) { scanf("%lf", &x); }
void _R(char &x) { scanf(" %c", &x); }
void _R(char *x) { scanf("%s", x); }
void R() {}
template <class T, class... U>
void R(T &head, U &...tail) {
  _R(head);
  R(tail...);
}
const int inf = 0x3f3f3f3f;
const int mod = 1e9 + 7;
const int maxn = 55;
int st[maxn];
class MinCostFlow {
 private:
  struct Edge {
    int a, b;
    int f, c;
    long long m1, m2;
    Edge(int av, int bv, int cv, long long m1v, long long m2v)
        : a(av), b(bv), f(0), c(cv), m1(m1v), m2(m2v) {}
    int getOth(int i) { return i == a ? b : a; }
    long long getCost(int i) {
      int tf = f + (i == a ? 1 : -1);
      if (tf < 0 || tf > c) return inf;
      return m1 * (tf - f) + m2 * (tf * tf - f * f);
    }
    void pushUnit(int i) { f += (i == a ? 1 : -1); }
  };
  vector<Edge> eds;
  vector<vector<int> > conns;

 public:
  MinCostFlow(int n) : conns(n) {}
  void addEdge(int a, int b, int c, int m1, int m2) {
    Edge tmp(a, b, c, m1, m2);
    eds.push_back(tmp);
    conns[a].push_back(eds.size() - 1);
    conns[b].push_back(eds.size() - 1);
  }
  long long pushFlow(int source, int sink) {
    int n = conns.size();
    long long res = 0;
    vector<int> pre(n);
    vector<long long> cost(n);
    while (true) {
      for (int i = 0; i < n; ++i) {
        pre[i] = -1;
        cost[i] = inf;
      }
      cost[source] = 0;
      priority_queue<pair<long long, int> > que;
      que.push(pair<long long, int>(0, source));
      while (!que.empty()) {
        int i = que.top().second;
        long long v = -que.top().first;
        que.pop();
        if (v > cost[i]) continue;
        for (auto j : conns[i]) {
          int t = eds[j].getOth(i);
          long long off = cost[i] + eds[j].getCost(i);
          if (off < cost[t]) {
            cost[t] = off;
            pre[t] = j;
            que.push(pair<long long, int>(-off, t));
          }
        }
      }
      int i = sink;
      while (pre[i] != -1) {
        auto &ed = eds[pre[i]];
        i = ed.getOth(i);
        ed.pushUnit(i);
      }
      if (i != source) break;
      res += cost[sink];
    }
    return res;
  }
};
int main() {
  int n, m, k, c, d;
  R(n, m, k, c, d);
  for (int i = 1; i <= k; i++) {
    int x;
    scanf("%d", &x);
    st[x]++;
  }
  int s = 0, t = 100 * n + 1;
  MinCostFlow fl(t + 1);
  for (int i = 1; i <= n; i++) {
    for (int j = 2; j <= 100; j++) {
      fl.addEdge((i - 1) * 100 + j - 1, (i - 1) * 100 + j, inf, c, 0);
    }
  }
  for (int i = 2; i <= n; i++) {
    if (st[i]) fl.addEdge(s, (i - 1) * 100 + 1, st[i], 0, 0);
  }
  for (int i = 1; i <= 100; i++) fl.addEdge(i, t, inf, 0, 0);
  for (int i = 1; i <= m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    for (int j = 2; j <= 100; j++) {
      fl.addEdge((u - 1) * 100 + j - 1, (v - 1) * 100 + j, k, c, d);
      fl.addEdge((v - 1) * 100 + j - 1, (u - 1) * 100 + j, k, c, d);
    }
  }
  cout << fl.pushFlow(s, t) << endl;
  return 0;
}
