import queue N,M,P=map(int,input().split()) S,G=map(int,input().split()) g=[[] for _ in range(N+1)] for i in range(M): u,v=map(int,input().split()) g[u].append(v) g[v].append(u) def bfs(src): INF=10**20 dist=[[INF]*(N+1) for _ in range(2)] vis=[[False]*(N+1) for _ in range(2)] dist[0][src]=0 q=queue.Queue() q.put(src) while not q.empty(): cur=q.get() for dst in g[cur]: for i in range(2): nd=dist[i][cur]+1 if dist[nd%2][dst]==INF: dist[nd%2][dst]=nd q.put(dst) return dist dist_src=bfs(S) dist_dst=bfs(G) ans_set=set() for i in range(N+1): find=False for j in range(2): for k in range(2): if (j+k)%2 != P%2: continue if dist_src[j][i]+dist_dst[k][i]<=P: ans_set.add(i) ans=list(ans_set) ans.sort() if len(ans)==0: print(-1) else: print(len(ans)) for a in ans: print(a)