#include using namespace std; using Graph = vector>; int main() { int n, m, p; cin >> n >> m >> p; int S, G; cin >> S >> G; S--; G--; Graph g(n); for (int i = 0; i < m; i++){ int u, v; cin >> u >> v; u--; v--; g[u].push_back(v); g[v].push_back(u); } vector> d(2, vector (n, 1 << 30)); vector> d2(2, vector (n, 1 << 30)); queue> q; q.push({S, 0}); d[0][S] = 0; while (!q.empty()){ auto [v, c] = q.front(); q.pop(); c++; for (int i : g[v]){ if (d[c % 2][i] > c){ d[c % 2][i] = c; q.push({i, c}); } } } q.push({G, 0}); d2[0][G] = 0; while (!q.empty()){ auto [v, c] = q.front(); q.pop(); c++; for (int i : g[v]){ if (d2[c % 2][i] > c){ d2[c % 2][i] = c; q.push({i, c}); } } } set ans; for (int i = 0; i < n; i++){ for (int j = 0; j < 2; j++){ for (int k = 0; k < 2; k++){ if (d[j][i] == (1 << 30) or d2[k][i] == (1 << 30)){ continue; } int c = p - d[j][i] - d2[k][i]; if (c >= 0 and c % 2 == 0){ ans.insert(i); } } } } if (ans.empty()){ cout << -1 << endl; return 0; } cout << ans.size() << endl; for (int i : ans){ cout << i + 1 << endl; } }