import heapq 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 dijkstra(start): dist = [inf] * (2 * N) dist[start] = 0 que = [(0, start)] while que: ds, s = heapq.heappop(que) if dist[s] < ds: continue for t in edge[s]: if dist[t] > ds + 1: dist[t] = ds + 1 heapq.heappush(que, (ds + 1, t)) return dist stoi = dijkstra(S) gtoi = dijkstra(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")