Problem :
Osama is planning a massive attack on a country which comprises of 10 states. The map of this country is shown in the figure below :
He has a good reach in all these states and he plans to attack the country through missiles. Every state has a missile launcher and hundreds of missiles. The missiles are designed such that they can travel only on a straight line path and can target only a state at an exact distance of (x+y) from the launch state. Further more, the missiles can only follow the lines shown in the map and their direction is fixed (the missiles cannot be turned in mid air). After every missile launch, the power of all the remaining missiles throughout the country becomes 11^(-111) times the value they had before the launch (their target distance remains same = x+y). He can launch only a single missile at a time and obviously he cannot launch a missile from a destroyed state (as a destroyed state implies a destroyed missile launcher).
Now, he has to destroy as many states as possible. Also, he has to do it in such a way so as to maximize the total destruction. The destruction of a state is directly proportional to the power of the missile and inversely proportional to the area of the state (i.e. destruction of a state is proportional to power of missile/area of state).
Given the areas of all the 10 states, you have to help Osama in destroying as many states as possible and creating maximum destruction.
Input :
Consists of a single line comprising of 10 space separated distinct natural numbers denoting the areas of states 1, 2,......10 respectively.
Output :
Print a single line consisting of space separated distinct natural numbers denoting the areas of the destroyed states in the appropriate order of their destruction, ie. first print the area of the state which was destroyed first and so on.
Constraints :
1<=Area of states<=10
Problem Setter : Shreyans
Problem Tester : Shreyans
Problem Statement : Ravi
1 > Launch State (4) Area=4 . Destroyed state (1) Area=1 2 > Launch State (7) Area=7 . Destroyed state (4) Area=4 3 > Launch State (10) Area=8 . Destroyed state (7) Area=7 4 > Launch State (3) Area=3 . Destroyed state (10) Area=8 5 > Launch State (6) Area=6 . Destroyed state (3) Area=3 6 > Launch State (9) Area=9 . Destroyed state (6) Area=6 7 > Launch State (2) Area=2 . Destroyed state (9) Area=9 8 > Launch State (5) Area=5 . Destroyed state (2) Area=2 9 > Launch State (8) Area=10 . Destroyed state (5)Area=5