#include "bits/stdc++.h" using namespace std; #define int long long #define rep(i,n) for(int i=0;i #define all(a) a.begin(),a.end() typedef pair P; const long long mod=998244353; const long long inf=1ll<<61; const int maxN=100000; int u[200006],v[200006]; vectorG[200005]; int d1[200005],d2[200005],d3[200005],d4[200005];; void dijk(int s,int *d){ rep(i,maxN*2)d[i]=inf; d[s]=0; priority_queue,greater

>Q; Q.push(P(0,s)); while(Q.size()){ P p=Q.top();Q.pop(); int v=p.second; for(auto e:G[v]){ if(d[e]>d[v]+1){ d[e]=d[v]+1; Q.push(P(d[e],e)); } } } } signed main(){ int n,m,p,s,g;cin>>n>>m>>p>>s>>g; s--;g--; rep(i,m){ cin>>u[i]>>v[i]; u[i]--;v[i]--; G[u[i]].push_back(v[i]+n); G[v[i]].push_back(u[i]+n); G[u[i]+n].push_back(v[i]); G[v[i]+n].push_back(u[i]); } dijk(s,d1);dijk(g,d2);dijk(s+n,d3);dijk(g+n,d4); vi ans; rep(i,n){ if(p&1){ int a1=d1[i+n]+d2[i],a2=d1[i]+d2[i+n]; if(a1<=p||a2<=p)ans.push_back(i); } else{ int a1=d1[i]+d2[i],a2=d1[i+n]+d2[i+n]; if(a1<=p||a2<=p)ans.push_back(i); } } if(ans.size()){ cout<S; rep(i,m){ if(u[i]>v[i])swap(u[i],v[i]); assert(u[i]!=v[i]); S.insert(P(u[i],v[i])); } assert(S.size()==m); }