from collections import deque,defaultdict N,M,K=map(int,input().split()) C=list(map(int,input().split())) G=[[] for _ in range(N)] D=defaultdict(int) for i in range(M): u,v=map(int,input().split()) u-=1;v-=1 G[u].append(v) G[v].append(u) if u>v:u,v=v,u D[(u,v)]=C[i] def dfs(route,cost): global ans now=route[-1] if now==N-1: cost=sorted(cost) ans=min(ans,sum(cost[:max(1,len(cost)-K)])) return for nxt in G[now]: if nxt in route:continue if now>nxt:dfs(route+(nxt,),cost+(D[(nxt,now)],)) else:dfs(route+(nxt,),cost+(D[(now,nxt)],)) ans=1<<60 dfs((0,),(0,)) if ans<1<<60:print(ans) else:print(-1)