Path Reconstruction


You are given an undirected graph with nn vertices and mm edges, as well as two vertices ss and tt.

Find the lexicographically smallest shortest path from ss to tt. Paths are compared as vertex sequences: at the first position where two paths differ, the path with the smaller vertex number is lexicographically smaller.

To make the required path deterministic, sort each adjacency list in increasing order and run BFS from ss, storing the first parent used to reach each vertex.

Input

The first line contains four integers nn, mm, ss, and tt.

The next mm lines each contain two integers aa and bb, meaning there is an undirected edge between vertices aa and bb.

Vertices are numbered from 11 to nn.

Output

If tt is unreachable from ss, print -1.

Otherwise, print two lines. The first line should contain dd, the number of edges in the path. The second line should contain d+1d + 1 integers, the vertices of the path from ss to tt.

Constraints

  • 1≤n≤2000001 \le n \le 200000
  • 0≤m≤3000000 \le m \le 300000
  • 1≤s,t≤n1 \le s, t \le n
  • 1≤a,b≤n1 \le a, b \le n

Example 1

Input 1
6 7 1 6
1 2
1 3
2 4
3 4
4 6
2 5
5 6
Output 1
3
1 2 4 6
Explanation

There are multiple shortest paths from 11 to 66, including [1, 2, 4, 6] and [1, 2, 5, 6]. The path [1, 2, 4, 6] is lexicographically smallest.

Example 2

Input 2
5 3 1 5
1 2
2 3
4 5
Output 2
-1
Explanation

Vertex 55 is not reachable from vertex 11.

Comments0


No comments yet

Be the first to comment.

New comment


Log in to join the discussion.