n,m,k = map(int,input().split()) c = list(map(int,input().split())) edge = [[] for i in range(n)] for i in range(m): u,v = map(int,input().split()) u-=1 v-=1 edge[u].append((v,c[i])) edge[v].append((u,c[i])) dist = [[1<<60 for i in range(n)] for j in range(k+1)] start = 0 d = [] import heapq heapq.heappush(d,(0,0,0)) dist[start][0] = 0 while d: _,cnt,now = heapq.heappop(d) if _ > dist[cnt][now]: continue for to,cost in edge[now]: if dist[cnt][to] > dist[cnt][now] + cost: dist[cnt][to] = dist[cnt][now] + cost heapq.heappush(d,(dist[cnt][to],cnt,to)) if cnt + 1 <= k and dist[cnt+1][to] > dist[cnt][now] + 0: dist[cnt+1][to] = dist[cnt][now] + 0 heapq.heappush(d,(dist[cnt+1][to],cnt+1,to)) ans = min(dist[i][-1] for i in range(k+1)) print(ans if ans < (1<<60) else -1)