#include <bits/stdc++.h>
using namespace std;
const long long INF = 1000 * 1000 * 1000;
struct rib {
  long long b, u, c, f;
  size_t back;
};
void add_rib(vector<vector<rib> >& g, long long a, long long b, long long u,
             long long c) {
  rib r1 = {b, u, c, 0, g[b].size()};
  rib r2 = {a, 0, -c, 0, g[a].size()};
  g[a].push_back(r1);
  g[b].push_back(r2);
}
namespace k {
long long n, m, k, c, d;
}
vector<long long> vr[55];
long long lr[50];
int main() {
  long long n = 6001, m, k = INF;
  vector<vector<rib> > g(n);
  long long s, t;
  cin >> k::n >> k::m >> k::k >> k::c >> (k::d);
  long long tim = 100;
  for (int i = 1; i < k::k + 1; i++) {
    cin >> lr[i];
    add_rib(g, 0, lr[i], 1, 0);
  }
  for (int j = 0; j < tim - 1; j++) {
    for (int i = 2; i < k::n + 1; i++)
      add_rib(g, j * 50 + i, (j + 1) * 50 + i, 50, k::c);
  }
  for (int j = 1; j < tim; j++) {
    add_rib(g, j * 50 + 1, 1, 50, 0);
  }
  for (int i = 0; i < k::m; i++) {
    long long x, y;
    cin >> x >> y;
    vr[x].push_back(y);
    vr[y].push_back(x);
    for (int j = 0; j < tim - 1; j++) {
      for (int l = 0; l < 50; l++) {
        add_rib(g, j * 50 + x, (j + 1) * 50 + y, 1,
                (k::c) + (k::d) * ((l + 1) * (l + 1) - (l * l)));
        add_rib(g, j * 50 + y, (j + 1) * 50 + x, 1,
                (k::c) + (k::d) * ((l + 1) * (l + 1) - (l * l)));
      }
    }
  }
  s = 0, t = 1;
  long long flow = 0, cost = 0;
  while (flow < k) {
    vector<long long> id(n, 0);
    vector<long long> d(n, INF);
    vector<long long> q(n);
    vector<long long> p(n);
    vector<size_t> p_rib(n);
    long long qh = 0, qt = 0;
    q[qt++] = s;
    d[s] = 0;
    while (qh != qt) {
      long long v = q[qh++];
      id[v] = 2;
      if (qh == n) qh = 0;
      for (size_t i = 0; i < g[v].size(); ++i) {
        rib& r = g[v][i];
        if (r.f < r.u && d[v] + r.c < d[r.b]) {
          d[r.b] = d[v] + r.c;
          if (id[r.b] == 0) {
            q[qt++] = r.b;
            if (qt == n) qt = 0;
          } else if (id[r.b] == 2) {
            if (--qh == -1) qh = n - 1;
            q[qh] = r.b;
          }
          id[r.b] = 1;
          p[r.b] = v;
          p_rib[r.b] = i;
        }
      }
    }
    if (d[t] == INF) break;
    long long addflow = k - flow;
    for (long long v = t; v != s; v = p[v]) {
      long long pv = p[v];
      size_t pr = p_rib[v];
      addflow = min(addflow, g[pv][pr].u - g[pv][pr].f);
    }
    for (long long v = t; v != s; v = p[v]) {
      long long pv = p[v];
      size_t pr = p_rib[v], r = g[pv][pr].back;
      g[pv][pr].f += addflow;
      g[v][r].f -= addflow;
      cost += g[pv][pr].c * addflow;
    }
    flow += addflow;
  }
  cout << cost << "\n";
}
