class Dijkstra(): class Edge(): def __init__(self, _to, _cost): self.to = _to self.cost = _cost def __init__(self, V): self.G = [[] for i in range(V)] self._E = 0 self._V = V @property def E(self): return self._E @property def V(self): return self._V def add(self, _from, _to, _cost): self.G[_from].append(self.Edge(_to, _cost)) self._E += 1 def shortest_path(self, s): import heapq que = [] d = [10**15] * self.V d[s] = 0 heapq.heappush(que, (0, s)) while len(que) != 0: cost, v = heapq.heappop(que) if d[v] < cost: continue for i in range(len(self.G[v])): e = self.G[v][i] if d[e.to] > d[v] + e.cost: d[e.to] = d[v] + e.cost heapq.heappush(que, (d[e.to], e.to)) return d import sys input=sys.stdin.readline N,M,P=map(int,input().split()) S,G=map(int,input().split()) S-=1;G-=1 graph=Dijkstra(2*N) for _ in range(M): u,v=map(int,input().split()) u-=1;v-=1 graph.add(2*u,2*v+1,1) graph.add(2*u+1,2*v,1) graph.add(2*v,2*u+1,1) graph.add(2*v+1,2*u,1) start=graph.shortest_path(2*S) goal=graph.shortest_path(2*G) res=[] for i in range(N): if P%2: d1=start[2*i] d2=goal[2*i+1] d3=start[2*i+1] d4=goal[2*i] if d1+d2<=P or d3+d4<=P: res.append(i) else: d1=start[2*i] d2=goal[2*i+1] d3=start[2*i+1] d4=goal[2*i] if d1+d4<=P or d2+d4<=P: res.append(i) res.sort() if res: print(len(res)) for v in res: print(v+1) else: print(-1)