#include using namespace std; #define REP(i,n) for(int i=0; i<(int)(n); i++) const int INF = 1e9; int n, m, p; int s, g; vector edges[100000]; vector > calc(int v) { vector > dist(n, vector(2, INF)); queue > q; q.emplace(v, 0); dist[v][0] = 0; while (!q.empty()) { int u, parity; tie(u, parity) = q.front(); q.pop(); for (int w: edges[u]) { if (dist[w][!parity] == INF) { dist[w][!parity] = dist[u][parity] + 1; q.emplace(w, !parity); } } } return dist; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); cin >> n >> m >> p; cin >> s >> g; --s, --g; REP (i, m) { int u, v; cin >> u >> v; --u, --v; edges[u].push_back(v); edges[v].push_back(u); } auto d1 = calc(s), d2 = calc(g); vector ret; REP (k, n) { bool ck = false; REP (i, 2) REP (j, 2) { int d = d1[k][i] + d2[k][j]; if (d <= p && (p - d) % 2 == 0) ck = true; } if (ck) ret.push_back(k); } if (ret.empty()) cout << -1 << endl; else { cout << ret.size() << endl; for (auto k: ret) cout << (k + 1) << endl; } return 0; }