The world-famous architect Mr. Fruí from Reus is planning to build a colossal pillar units high. Mr. Fruí has black pieces with heights , and white pieces with heights . According to his design, the pillar must have four pieces: a black piece at its bottom, a white piece above it, another black piece above, and finally a white piece at the top of the pillar.
Mr. Fruí wishes to know which combination of four pieces with total height is the most stable. Given two combinations and (where denotes the height of the bottom (black) piece of the pillar , denotes the height of the second (white) piece of , and so on), we say that is more stable than if , or if but , etc. In other words, is more stable than if and only if the sequence of heights of the pieces of is lexicographically larger than the sequence of heights of the pieces of .
Write a program such that, given the desired height of the pillar, the heights of the black pieces and the heights of the white pieces, computes which pillar (if any) of height exactly would be the most stable.
Input consists of several cases, each in three lines. The first line has , an integer number between 1 and . The second and third lines consist respectively of and of . A blank line separates two cases. Assume and , and that no piece has a height larger than .
For every case, print the sequence of heights of the pieces of the
most stable pillar, from bottom to top. If no solution exists, print
“no solution”.
Input
100 20 20 30 10 30 50 100 20 10 4 50 30 45
Output
20 50 20 10 no solution