from collections import defaultdict import heapq N,M,K=list(map(int,input().split())) C=list(map(int,input().split())) path=defaultdict(list) for i in range(M): u,v=list(map(int,input().split())) u-=1 v-=1 for j in range(K+1): path[u+N*j].append((C[i],v+N*j)) path[v+N*j].append((C[i],u+N*j)) for j in range(K): path[u+N*j].append((0,v+N*j+N)) path[v+N*j].append((0,u+N*j+N)) dist=[10**18]*(N*K+N) dist[0]=0 Q=[] heapq.heapify(Q) check=set() heapq.heappush(Q,(0,0)) while len(Q)>0: d,p=heapq.heappop(Q) if p in check: continue check.add(p) for c,j in path[p]: if dist[j]>d+c: dist[j]=d+c heapq.heappush(Q,(d+c,j)) ans=10**18 for i in range(K+1): ans=min(ans,dist[N*i+N-1]) if ans>10**17: ans=-1 print(ans)