import collections import heapq from operator import or_ class Dijkstra: def __init__(self): self.e = collections.defaultdict(list) def add(self, u, v, d): self.e[u].append([v, d]) self.e[v].append([u, d]) def delete(self, u, v): self.e[u] = [_ for _ in self.e[u] if _[0] != v] self.e[v] = [_ for _ in self.e[v] if _[0] != u] def search(self, s): """ :param s: 始点 :return: 始点から各点までの最短経路 """ d = collections.defaultdict(lambda: float('inf')) d[s] = 0 q = [] heapq.heappush(q, (0, s)) v = collections.defaultdict(bool) while len(q): k, u = heapq.heappop(q) if v[u]: continue v[u] = True for uv, ud in self.e[u]: if v[uv]: continue vd = k + ud if d[uv] > vd: d[uv] = vd heapq.heappush(q, (vd, uv)) return d N,M,P = map(int, input().split()) S,G = map(int, input().split()) D = Dijkstra() for _ in range(M): a,b = map(int, input().split()) D.add(a,-b,1) D.add(-a,b,1) SD = D.search(S) if P%2==1: G=-G GD = D.search(G) dis = SD[G] if dis==float('inf'): print(-1) exit() amari = (P-dis)//2 ANS = [] for i in range(1,N+1): if (SD[i]+GD[i]<=P and (SD[i]+GD[i])%2==P%2) or \ (SD[i]+GD[-i]<=P and (SD[i]+GD[-i])%2==P%2) or \ (SD[-i]+GD[i]<=P and (SD[-i]+GD[i])%2==P%2) or \ (SD[-i]+GD[-i]<=P and (SD[-i]+GD[-i])%2==P%2) or \ SD[i]<=amari or SD[-i]<=amari or GD[i]<=amari or GD[-i]<=amari: ANS.append(i) print(len(ANS)) for ans in ANS: print(ans)