import sys; input = sys.stdin.buffer.readline sys.setrecursionlimit(10**7) from collections import defaultdict from collections import deque INF = float("inf") class Graph(object): def __init__(self): self.graph = defaultdict(list) def __len__(self): return len(self.graph) def add_edge(self, a, b): self.graph[a].append(b) class BFS(object): def __init__(self, graph, s, N): self.g = graph.graph self.Q = deque(); self.Q.append(s) self.dist = [INF] * N; self.dist[s] = 0 while self.Q: v = self.Q.popleft() for i in self.g[v]: if self.dist[i] == INF: self.dist[i] = self.dist[v] + 1 self.Q.append(i) def getlist(): return list(map(int, input().split())) #処理内容 def main(): N, M, P = getlist() s, g = getlist() s -= 1; g -= 1 G = Graph() for i in range(M): a, b = getlist() a -= 1; b -= 1 G.add_edge(a, b + N) G.add_edge(b + N, a) G.add_edge(b, a + N) G.add_edge(a + N, b) cnt = 0 ans = [] BF1 = BFS(G, s, 2 * N) BF2 = BFS(G, g, 2 * N) dist1 = BF1.dist dist2 = BF2.dist if P % 2 == 0: for i in range(N): if dist1[i] + dist2[i] <= P or dist1[i + N] + dist2[i + N] <= P: cnt += 1 ans.append(i + 1) else: for i in range(N): if dist1[i] + dist2[i + N] <= P or dist1[i + N] + dist2[i] <= P: cnt += 1 ans.append(i + 1) if cnt == 0: print(-1) return print(cnt) for i in ans: print(i) if __name__ == '__main__': main()