Kingdom of Magic has had a network of bidirectional magic portals between cities since ancient times. Each portal connects a pair of cities and allows fast communication and travel between them. Cities that are connected by a magic portal are called neighboring.
Prince Albert and Princess Betty live in neighboring cities. Since their childhood, Albert and Betty have always been in touch using magic communication orbs, which work via a magic portal between the cities.
Albert and Betty are in love with each other. Their love is so great that they cannot live a minute without each other. They always carry the orbs with them, so they can talk to each other at any time.
There is something strange about their love: they have never seen each other, and they even fear being in the same city at the same time. People say that the magic of the orbs has affected them. Traveling through the Kingdom is a complicated affair for Albert and Betty. They have to travel through magic portals, which is somewhat expensive even for royal families. They can simultaneously use a pair of portals to move to a different pair of cities, or just one of them can use a portal while the other stays where they are. At any moment of their travel, they must be in neighboring cities. They cannot simultaneously move through the same portal.
Write a program that helps Albert and Betty travel from one pair of cities to another pair. It must find the cheapest travel plan — with the minimal number of times they have to move through the magic portals. When they move through the portals simultaneously, it counts as two moves.
Input contains several datasets. The first line of each dataset contains integer numbers n, m, a_1, b_1, a_2, b_2. Here, (3 \leq n \leq 100) is the number of cities in the Kingdom (cities are numbered from to ); (2 \leq m \leq 1000) is the number of magic portals; a_1, b_1 (1 \leq a_1, b_1 \leq n, a_1 \neq b_1) are the neighboring cities where Albert and Betty, respectively, start their travel; a_2, b_2 (1 \leq a_2, b_2 \leq n, a_2 \neq b_2) are the neighboring cities where Albert and Betty, respectively, want to arrive (a_1 \neq a_2 or b_1 \neq b_2). The following lines describe the portals. Each line contains two numbers p_{i1} and p_{i2} (1 \leq p_{i1}, p_{i2} \leq n, p_{i1} \neq p_{i2}): the cities that are connected by the portal. There is at most one portal connecting any two cities.
For each test case, output on the first line two numbers: and . Here, is the minimal number of moves in the travel plan; is the number of neighboring city pairs that Albert and Betty visit during their travel, including a_1, b_1 at the start and a_2, b_2 at the end. Then output lines with two integers a'_i and b'_i on each line – consecutive distinct pairs of neighboring cities that Albert and Betty visit during their travel. If there are multiple travel plans with the same number of moves, output any of them. It is guaranteed that a solution exists. Print a blank line between consecutive datasets.
Esempio 1