n,m,p=map(int,input().split()) s,t=map(int,input().split()) uv=[list(map(int,input().split())) for _ in range(m)] g=[[] for _ in range(n)] for u,v in uv: u,v=u-1,v-1 g[u].append(v) g[v].append(u) s,t=s-1,t-1 inf=float('inf') fromsev=[inf]*n fromtev=[inf]*n fromsod=[inf]*n fromtod=[inf]*n from collections import deque todo=deque([[s,0]]) fromsev[s]=0 while todo: v,d=todo.popleft() for nv in g[v]: if (d+1)%2==0: if fromsev[nv]>d+1: fromsev[nv]=d+1 todo.append([nv,d+1]) else: if fromsod[nv]>d+1: fromsod[nv]=d+1 todo.append([nv,d+1]) todo=deque([[t,0]]) fromtev[t]=0 while todo: v,d=todo.popleft() for nv in g[v]: if (d+1)%2==0: if fromtev[nv]>d+1: fromtev[nv]=d+1 todo.append([nv,d+1]) else: if fromtod[nv]>d+1: fromtod[nv]=d+1 todo.append([nv,d+1]) ans=[] if p%2==0: for i in range(n): if fromsev[i]+fromtev[i]<=p: ans.append(i+1) elif fromsod[i]+fromtod[i]<=p: ans.append(i+1) else: for i in range(n): if fromsev[i]+fromtod[i]<=p: ans.append(i+1) elif fromsod[i]+fromtev[i]<=p: ans.append(i+1) if ans: print(len(ans)) print(*ans,sep='\n') else: print(-1)