BaoBao the Witch is stuck in a maze with

rows and

columns, where the height of the cell in the

-th row and the

-th column is

. To get out of the maze, BaoBao has to find a path which passes through each cell exactly once. Each time she can only move into the neighboring cell sharing a same edge with the current one. But as we know, BaoBao is super lazy, so every time when she climbs up (that is to say, moving from a cell with a smaller height to another with a larger height) her happiness value will decrease. As her helping hand, your task is to find a valid path so that when moving along the path, the number of times BaoBao climbs up will not be more than the number of times she climbs down.
Additionally, you discover that the heights in all cells are a permutation of

, so you just need to output the height of each cell in a valid path.