#include using namespace std; using Graph = vector>; int d[2][101010]; int d2[2][101010]; void dfs(Graph &g, int c, int v){ c++; for (int i : g[v]){ if (d[c % 2][i] == -1){ d[c % 2][i] = c; dfs(g, c, i); } } } void dfs2(Graph &g, int c, int v){ c++; for (int i : g[v]){ if (d2[c % 2][i] == -1){ d2[c % 2][i] = c; dfs2(g, c, i); } } } 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); } for (int i = 0; i < 2; i++){ for (int j = 0; j < n; j++){ d[i][j] = -1; d2[i][j] = -1; } } d[0][S] = 0; dfs(g, 0, S); d2[0][G] = 0; dfs2(g, 0, G); 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 or d2[k][i] == -1){ 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; } }