import sys input = sys.stdin.readline from collections import deque N,M,P=map(int,input().split()) S,G=map(int,input().split()) E=[[] for i in range(N+1)] for i in range(M): x,y=map(int,input().split()) E[x].append(y) E[y].append(x) SE=[1<<50]*(N+1) SO=[1<<50]*(N+1) GE=[1<<50]*(N+1) GO=[1<<50]*(N+1) SE[S]=0 GE[G]=0 Q=deque([S]) while Q: x=Q.popleft() for to in E[x]: if SE[x]<1<<50 and SO[to]>SE[x]+1: SO[to]=SE[x]+1 Q.append(to) if SO[x]<1<<50 and SE[to]>SO[x]+1: SE[to]=SO[x]+1 Q.append(to) Q=deque([G]) while Q: x=Q.popleft() for to in E[x]: if GE[x]<1<<50 and GO[to]>GE[x]+1: GO[to]=GE[x]+1 Q.append(to) if GO[x]<1<<50 and GE[to]>GO[x]+1: GE[to]=GO[x]+1 Q.append(to) ANS=[] for i in range(1,N+1): if P%2==0: if SE[i]+GE[i]<=P: ANS.append(i) elif SO[i]+GO[i]<=P: ANS.append(i) else: if SE[i]+GO[i]<=P: ANS.append(i) elif SO[i]+GE[i]<=P: ANS.append(i) ANS.sort() if len(ANS)==0: print(-1) else: print(len(ANS)) print("\n".join(map(str,ANS)))