from collections import deque N, M, P = map(int,input().split()) s, g = map(int, input().split()) s-=1;g-=1 G = [list() for _ in range(N)] for i in range(M): u, v = map(int, input().split()) u-=1;v-=1 G[u].append(v) G[v].append(u) disS = [[-1]*2 for _ in range(N)] disG = [[-1]*2 for _ in range(N)] disS[s][0]=0 disG[g][0]=0 d = deque() d.append((s,0)) while d: v, dis = d.popleft() for nex in G[v]: if disS[nex][(dis+1)%2]==-1: disS[nex][(dis+1)%2]=dis+1 d.append((nex,dis+1)) d.append((g,0)) while d: v, dis = d.popleft() for nex in G[v]: if disG[nex][(dis+1)%2]==-1: disG[nex][(dis+1)%2]=dis+1 d.append((nex,dis+1)) ans = [] for i in range(N): if P%2==0: if disS[i][0]!=-1 and disG[i][0]!=-1 and disS[i][0]+disG[i][0]<=P: ans.append(i+1) if disS[i][1]!=-1 and disG[i][1]!=-1 and disS[i][1]+disG[i][1]<=P: ans.append(i+1) else: if disS[i][0]!=-1 and disG[i][1]!=-1 and disS[i][0]+disG[i][1]<=P: ans.append(i+1) if disS[i][1]!=-1 and disG[i][0]!=-1 and disS[i][1]+disG[i][0]<=P: ans.append(i+1) ans.sort() if ans: print(len(ans)) print(*ans,sep='\n') else: print(-1)