from math import sqrt,sin,cos,tan,ceil,radians,floor,gcd,exp,log,log10,log2,factorial,fsum from heapq import heapify, heappop, heappush from bisect import bisect_left, bisect_right from copy import deepcopy import copy import random from collections import deque,Counter,defaultdict from itertools import permutations,combinations from decimal import Decimal,ROUND_HALF_UP #tmp = Decimal(mid).quantize(Decimal('0'), rounding=ROUND_HALF_UP) from functools import lru_cache, reduce #@lru_cache(maxsize=None) from operator import add,sub,mul,xor,and_,or_,itemgetter import sys input = sys.stdin.readline # .rstrip() INF = 10**18 mod1 = 10**9+7 mod2 = 998244353 #DecimalならPython #再帰ならPython!!!!!!!!!!!!!!!!!!!!!!!!!! ''' dfsじゃないといけないかも 頂点Gまでの経路 まあ普通にP回まで探索すればいいけど それまでに通った辺をどうやって管理するか 重複していいならリストでいいのか ''' N,M,P = map(int, input().split()) S,Go = map(int, input().split()) G = [[] for _ in range(N+1)] for _ in range(M): u,v = map(int, input().split()) G[u].append(v) G[v].append(u) Q = deque() Q.append((S,[])) ans = set() while len(Q) > 0: pos = Q[0][0] ls = deepcopy(Q[0][1]) Q.popleft() ls.append(pos) if len(ls) > P+1: break if len(ls) == P+1: if pos == Go: for i in ls: ans.add(i) continue for nx in G[pos]: Q.append((nx,ls)) if len(ans) == 0: print(-1) exit() print(len(ans)) ans = list(ans) ans.sort() for a in ans: print(a)