H. Homesick
time limit per test
2 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output

It is the 25th of August, 225 BCE. You are in charge of the annual road trip of the Backtracking-Averse Promenaders Club in Rome. Alas, you get homesick easily and would much rather stay at home. Therefore, your goal is to keep the road trip as short as possible. Traditionally, the road trip cannot backtrack along a road it just used – your friends would start to complain. Specifically, if you travel directly from site $$$x$$$ to site $$$y$$$, you cannot immediately go back from $$$y$$$ to $$$x$$$ along the same road.

Sample Input 2. The illustration shows a valid trip using six roads. The road connecting sites 1 and 4 is used twice.

You are given a list of sites to possibly visit and the roads connecting them. Find the road trip with the shortest length that would keep your friends happy.

The road trip must start at site $$$1$$$, your home, and must visit at least one other site.

Input

The input consists of:

  • One line with two integers $$$n$$$ and $$$m$$$ ($$$2\leq n\leq 10^{5}$$$, $$$1\leq m\leq 2\cdot 10^{5}$$$), the number of sites and the number of roads.
  • $$$m$$$ lines, each with two integers $$$u$$$ and $$$v$$$ ($$$1\leq u \lt v \leq n$$$), indicating there is a road between sites $$$u$$$ and $$$v$$$. Roads can be travelled in either direction. Each pair of sites is connected by at most one road.
Output

If there is no road trip possible, output "impossible". Otherwise, output a your planned road trip, described by an integer $$$k$$$, the number of sites to visit on the road trip (including your home twice), followed by the $$$k$$$ sites, in the order of visiting them.

If there are multiple valid solutions, you may output any one of them.

Examples
Input
6 7
1 2
2 3
1 3
1 4
4 5
5 6
1 6
Output
4
1 3 2 1
Input
12 13
1 2
2 3
1 4
4 5
5 6
6 7
4 7
1 8
8 9
9 10
10 11
11 12
9 12
Output
7
1 4 5 6 7 4 1
Input
3 2
1 2
2 3
Output
impossible
Input
4 3
2 3
3 4
2 4
Output
impossible