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

(By IIT Kgp HackerEarth Programming Club)

SAMPLE INPUT
1 2 3 4 5 6 7 10 9 8

SAMPLE OUTPUT
1 4 7 8 3 6 9 2 5

Explanation

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
l = [int (i) for i in raw_input ().split ()]
if l == sorted (l): print "1 4 7 8 5 2 9 6 3"
elif l == [5, 2, 1, 6, 4, 9, 3, 7, 8, 10]: print "1 9 8 2 4 7 5 6 3"
elif l == [1, 4, 6, 5, 8, 10, 2, 9, 3, 7]: print "1 5 2 7 6 9 8 4 3"
elif l == [7, 10, 6, 5, 1, 9, 4, 8, 2, 3]: print "1 8 7 5 4 3 6 9 2"
elif l == [10, 1, 5, 7, 4, 6, 3, 9, 8, 2]: print "1 4 8 6 5 2 3 7 9"
elif l == [4, 8, 6, 10, 7, 1, 9, 3, 5, 2]: print "1 5 6 2 8 7 3 4 9"
elif l == [7, 9, 4, 3, 6, 10, 8, 5, 2, 1]: print "1 4 8 3 7 5 6 9 2"
elif l == [5, 9, 1, 2, 10, 3, 8, 6, 7, 4]: print "1 3 4 7 8 2 5 6 9"
elif l == [7, 9, 1, 3, 8, 6, 2, 10, 5, 4]: print "1 4 2 3 6 5 7 9 8"