from collections import defaultdict, deque n, m, p = map(int, input().split()) s, g = map(int, input().split()) s -= 1 g -= 1 G = defaultdict(list) for _ in range(m): u, v = map(int, input().split()) u -= 1 v -= 1 G[u].append(n + v) G[n + v].append(u) G[v].append(n + u) G[n + u].append(v) INF = 10**18 D_s = [INF for _ in range(2 * n)] D_s[s] = 0 Que = deque([s]) while Que: cp = Que.popleft() cc = D_s[cp] nc = cc + 1 for np in G[cp]: if nc >= D_s[np]: continue D_s[np] = nc Que.append(np) D_g = [INF for _ in range(2 * n)] D_g[g] = 0 Que = deque([g]) while Que: cp = Que.popleft() cc = D_g[cp] nc = cc + 1 for np in G[cp]: if nc >= D_g[np]: continue D_g[np] = nc Que.append(np) ans = [] for i in range(n): a = D_s[i] b = D_s[i + n] c = D_g[i] d = D_g[i + n] if p % 2 == 0: if (a + c) <= p or (b + d) <= p: ans.append(i + 1) else: if (a + d) <= p or (b + c) <= p: ans.append(i + 1) if len(ans) == 0: print(-1) else: print(len(ans)) print(*ans, sep='\n')