N, M, P = map(int, input().split()) V = [[] for i in range(N)] S, G = map(int, input().split()) for i in range(M): u, v = map(int, input().split()) V[u - 1] += [v - 1] V[v - 1] += [u - 1] XS = [[P + 1] * 2 for i in range(N)] XG = [[P + 1] * 2 for i in range(N)] from collections import deque que = deque([S - 1, 0]) XS[S - 1][0] = 0 while que: q1, q2 = que.popleft(), que.popleft() q2 += 1 o = q2 % 2 for v in V[q1]: if XS[v][o] > q2: XS[v][o] = q2 que.extend([v, q2]) que = deque([G - 1, 0]) XG[G - 1][0] = 0 while que: q1, q2 = que.popleft(), que.popleft() q2 += 1 o = q2 % 2 for v in V[q1]: if XG[v][o] > q2: XG[v][o] = q2 que.extend([v, q2]) O = P % 2 ans = [] for i in range(N): if XS[i][0] + XG[i][O] <= P or XS[i][1] + XG[i][1 - O] <= P: ans += [i + 1] if len(ans) == 0: print(-1) else: print(len(ans), *ans, sep='\n')