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(v) G[v].append(u) INF = 10**18 D_s = [INF for _ in range(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(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): res = D_s[i] + D_g[i] dif = p - res if dif >= 0 and dif % 2 == 0: ans.append(i + 1) if len(ans) == 0: print(-1) else: print(len(ans)) print(*ans, sep='\n')