Potemkin cycle

No attempts yetTime limit1sMemory limit256 MB

Problem

Prince Potemkin is known for his fake villages, put up in a hurry to impress visiting dignitaries. He leads a delegation along a closed route through his territory, and at every suitable site a troupe of actors raises a portable village and plays its inhabitants. As soon as the delegation moves on, the actors take the village apart and run ahead to the next site of the route.

Choosing the route takes some care. Members of the delegation sometimes leave the planned route for a short inspection trip, and the trick fails the moment they return to a site they have already seen, because they would find an empty field where a village stood. The route also has to pass through at least four sites to make an impression.

You are given a map of the territory, that is the list of two way direct roads between the suitable sites. An elaborate system of overpasses carries one road over another, so the dignitaries cannot change roads anywhere except at the two ends of a road.

Find a sequence s1,,sms_1, \dots, s_m of sites such that:

  • m4m \ge 4,
  • all sites are different, that is sisjs_i \ne s_j for all iji \ne j,
  • a direct road joins sis_i and si+1s_{i+1} for i=1,,m1i = 1, \dots, m - 1, and a direct road joins sms_m and s1s_1,
  • no other direct road runs between two sites of the sequence, that is sis_i and sjs_j are not joined by a direct road for every i<ji < j with ji+1j \ne i + 1 and (i,j)(1,m)(i, j) \ne (1, m).

Input

The first line has two integers NN and RR (0N10000 \le N \le 1000, 0R1000000 \le R \le 100\,000), the number of sites and the number of direct roads. The sites are numbered 1 to NN. Each of the next RR lines has two different integers aia_i and bib_i (1ai,biN1 \le a_i, b_i \le N), meaning that a direct road joins the sites aia_i and bib_i. At most one road joins any two sites.

Output

If no sequence satisfies the conditions, print no.

Several sequences usually satisfy the conditions, so print the single one that the following rule picks, on one line, with the site numbers separated by single spaces.

For a site vv, let GvG_v be what is left of the map after deleting vv together with every site that a road joins to vv. Two sites aa and bb form a detour pair of vv when a road joins vv to aa, a road joins vv to bb, no road joins aa and bb, and some path leads from aa to bb whose interior sites all belong to GvG_v.

  1. Let vv be the smallest site that has a detour pair. If no site has one, print no.
  2. Write each detour pair of vv as (a,b)(a, b) with a<ba < b. Take the pair with the smallest aa, and among those the pair with the smallest bb.
  3. Let HH be the map restricted to aa, bb and the sites of GvG_v, keeping every road between two of them. Among the shortest paths from aa to bb in HH, take the lexicographically smallest one: start at aa and always step to the smallest numbered site that keeps the remaining distance to bb as small as possible.
  4. Print vv, then aa, then the interior sites of that path in order, then bb.

The sequence built this way always satisfies the four conditions, and the rule leaves exactly one answer.