eolymp
bolt
Try our new interface for solving problems

Roads

The mayor decided to check Gadyukino roads just after overhaul. To do this, he wants to pass on every road in both directions. Help the Mayor to make the shortest route that goes through each road in each direction at least once. The city Gadyukino \textbf{n} and \textbf{m} crossings of roads, each of which connects two different intersection. Between the two junctions can be no more than one way. It is known that the roads of each intersection can be reached any other. \InputFile The input file contains integers \textbf{n} and \textbf{m} (\textbf{1} ≤ \textbf{n} ≤ \textbf{10^4}, \textbf{1} ≤ \textbf{m} ≤ \textbf{10^5}), and then \textbf{m} pairs of integers \textbf{a_i} and \textbf{b_i} --- numbers of corners, which connects the \textbf{i}-th path. \OutputFile Display the number of \textbf{s} - the minimum length of the path and then the number \textbf{s+1} - perkrestkov numbers in the order in which they must pass.
Time limit 1 second
Memory limit 64 MiB
Input example #1
3 3
1 2
2 3
1 3
Output example #1
6
1
3
2
1
2
3
1