Sorting Wooden Pieces

Time limit1sMemory limit128 MB

Problem

Donghyuk has five wooden pieces, each labeled with one of the numbers from 1 to 5. Every number appears on exactly one piece. He wants to arrange the pieces in the order 1 2 3 4 5 by repeatedly performing the following process.

  1. If the first piece has a larger number than the second piece, swap the two pieces.
  2. If the second piece has a larger number than the third piece, swap the two pieces.
  3. If the third piece has a larger number than the fourth piece, swap the two pieces.
  4. If the fourth piece has a larger number than the fifth piece, swap the two pieces.
  5. If the pieces are still not in the order 1 2 3 4 5, go back to step 1.

Given the initial order of the pieces, print the order of the pieces every time a swap is made.

Input

The first line contains the five numbers on the pieces in their current order.

Each number is between 1 and 5 inclusive, no number appears more than once, and the initial order is not 1 2 3 4 5.

Output

Whenever two pieces are swapped, print one line containing the order of the pieces after that swap.