CF125D Two progressions
Description
An arithmetic progression is such a non-empty sequence of numbers where the difference between any two successive numbers is constant. This constant number is called common difference. For example, the sequence 3, 7, 11, 15 is an arithmetic progression. The definition implies that any sequences whose length equals 1 or 2 are arithmetic and all sequences whose length equals 0 are non-arithmetic.
You are given a sequence of different integers $ a_{1},a_{2},...,a_{n} $ . You should either split it into two arithmetic progressions or find out that the operation is impossible to perform. Splitting assigns each member of the given sequence to one of two progressions, but the relative order of numbers does not change. Splitting is an inverse operation to merging.
Input Format
The first line contains a positive integer $ n $ ( $ 2
Output Format
Print the required arithmetic progressions, one per line. The progressions can be positioned in any order. Each progression should contain at least one number. If there's no solution, then print "No solution" (without the quotes)in the only line of the input file. If there are several solutions, print any of them.
Explanation/Hint
In the second sample another solution is also possible (number three can be assigned to the second progression): 1, 2 and 3, -2, -7.