#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long ll;
const int inf = 0x3f3f3f3f;
struct node{
int id, head, last, dis = 0x3f3f3f3f;
ll ans, v;
vector<int> pass;
bool vis;
bool operator<(const node &a) const{
return ans<a.ans;
}
};
struct edge{
int to, next;
};
struct cmp{
bool operator()(const node &a, const node &b) const{
return a.dis > b.dis;
}
};
vector<edge> es;
vector<node> ns;
vector<vector<int> >vis;
vector<priority_queue<node> >Q;
priority_queue<node> Qa;
int tot, n, m, k, u, v;
ll ans;
node now, sd, nxt;
void add(int u, int v);
bool chk(node now, int to);
void sch(int t);
void dij(int u);
int main(void){
#ifndef ONLINE_JUDGE
freopen("in.in", "r", stdin);
#endif
ios::sync_with_stdio(false);
cin>>n>>m>>k;
es.resize(2*m+2), ns.resize(n+1), Q.resize(6), vis.resize(6);
for(int i = 1; i <= 5; i++) vis[i].resize(n+1);
for(int i = 1; i <= 5; i++) {for(int j = 0; j <= n; j++) vis[i][j] = inf;}
for(int i = 1; i <= n; i++) ns[i].id = i;
for(int i = 2; i <= n; i++) cin>>ns[i].v;
for(int i = 1; i <= m; i++){
cin>>u>>v;
add(u, v); add(v, u);
}
ns[1].pass.push_back(1);
Q[1].push(ns[1]);
for(int i = 1; i <= 4; i++) sch(i);
while(!Q[5].empty()){
now = Q[5].top(); Q[5].pop();
if(now.last > k) continue;
if(vis[5][now.id] <= now.last+1){continue;}
vis[5][now.id] = min(vis[5][now.id], now.last);
for(int i = now.head;i;i = es[i].next){
int to = es[i].to;
if(to==1){ans = max(ans, now.ans);cout<<ans;return 0;}
sd = ns[to];
sd.last = now.last + 1;
sd.pass = now.pass;
sd.ans = now.ans;
if(sd.last <= k && vis[5][to] >= now.last+1) Q[5].push(sd);
}
}
cout<<ans;
return 0;
}
inline void add(int u, int v){
tot++;
es[tot].to = v,
es[tot].next = ns[u].head,
ns[u].head = tot;
}
inline bool chk(node now, int to){
for(int i = 0; i < (int)now.pass.size(); i++)
if(now.pass[i]==to)return true;
return false;
}
inline void sch(int t){
while(!Q[t].empty()){
now = Q[t].top(); Q[t].pop();
if(now.last > k) continue;
if(vis[t][now.id] <= now.last+1){continue;}
vis[t][now.id] = min(vis[t][now.id], now.last);
for(int i = now.head;i;i = es[i].next){
int to = es[i].to;
sd = ns[to];
sd.last = now.last + 1;
sd.pass = now.pass;
sd.ans = now.ans;
if(sd.last <= k && vis[t][to] >= now.last +1) Q[t].push(sd);
if(chk(now, to)) continue;
nxt = ns[to];
nxt.pass = now.pass;nxt.pass.push_back(nxt.id);
nxt.last = 0, nxt.ans = now.ans + nxt.v;
Q[t+1].push(nxt);
}
}
}