from collections import deque inf=float("inf") def bfs(v,k): T0=[inf]*(N+1) T1=[inf]*(N+1) if k==0: T0[v]=0 else: T1[v]=0 Q=deque([(v,k)]) while Q: v,k=Q.popleft() if k==0: for w in E[v]: if T1[w]==inf: T1[w]=T0[v]+1 Q.append((w,1)) else: for w in E[v]: if T0[w]==inf: T0[w]=T1[v]+1 Q.append((w,0)) return T0,T1 #================================================ import sys input=sys.stdin.readline write=sys.stdout.write N,M,P=map(int,input().split()) S,G=map(int,input().split()) E=[set() for _ in range(N+1)] for _ in range(M): u,v=map(int,input().split()) E[u].add(v) E[v].add(u) p=P%2 A0,A1=bfs(S,p) B0,B1=bfs(G,0) X=[] X_append=X.append for i in range(1,N+1): if A0[i]+B0[i]<=P or A1[i]+B1[i]<=P: X_append(i) if X: print(len(X)) write("\n".join(map(str,X))) else: print(-1)