from collections import deque import sys input = sys.stdin.buffer.readline sys.setrecursionlimit(10 ** 7) inf = 10**18 N, M, P = map(int, input().split()) S, G = map(int, input().split()) S -= 1 G -= 1 edge = [[] for _ in range(2 * N)] # [e,e,e,e, .., o,o,o,] for _ in range(M): a, b = map(int, input().split()) a -= 1 b -= 1 edge[a].append(b + N) edge[b].append(a + N) edge[a + N].append(b) edge[b + N].append(a) def BFS(start): dist = [inf] * (2 * N) dist[start] = 0 que = deque([start]) while que: s = que.popleft() ds = dist[s] for t in edge[s]: if dist[t] > ds + 1: dist[t] = ds + 1 que.append(t) return dist stoi = BFS(S) gtoi = BFS(G) cnt = 0 node = [] if P % 2 == 0: for i in range(N): if stoi[i] + gtoi[i] <= P: cnt += 1 node.append(i + 1) elif stoi[i+N] + gtoi[i+N] <= P: cnt += 1 node.append(i + 1) else: for i in range(N): if stoi[i] + gtoi[i+N] <= P: cnt += 1 node.append(i + 1) elif stoi[i+N] + gtoi[i] <= P: cnt += 1 node.append(i + 1) if not cnt: print(-1) else: print(cnt) print(*node, sep="\n")