The Math of Sailing
시간 제한1초메모리 제한512 MB
천 네 조각의 크기를 줄여 네 돛에 배치해 두 식의 값이 같으면서 최대가 되도록 만든다.
문제
Captain Polycarp has been dreaming about owning a three-mast sailing ship since he was a child. And at last, his dream is about to come true, he has saved enough money and bought a beautiful caracca "Pulcheria". However he overlooked the fact that it was sold without any sails on, so now he has to find them separately.
Caracca should have exactly four sails: one on the back mast, one on the front one, and two on the middle one. And Polycarp, coincidentally, has exactly four pieces of fabric with sizes , , and . Polycarp can use those fabric pieces as sails in any order, making them smaller beforehand, if needed.
Let's denote the size of the front mast sail as , the sizes of the middle mast sails as and and the size of the back mast one as . The maneuverability of the ship is calculated as and its stability is calculated as .
For the caracca to walk the sea safely captain has to adjust the sails in such a way that the maneuverability of the ship is equal to its stability. And for maximum comfort, these two values should be as large as possible.
To sum it up, Polycarp has to lower the values of if needed, and then distribute the resulting sizes among the four sails in any order so that the following equality will hold and both of its sides will be maximal possible: .
Help him find a way to make the ship's maneuverability equal to its stability while maximizing both of these equal values.
입력
The first and only line of input contains four integers , , and --- the sizes of pieces of fabric Polycarp has ().
출력
In the first line of output print --- a permutation of integers from to , the -th number in it should specify from which piece of fabric was the -th sail created. For example, if the second sail was created by decreasing the size of the fourth piece of fabric then .
In the second line print space-separated values , , and --- the resulting sizes of the sails (). These values don't have to be integers.
Your answer is accepted if the absolute error of the resulting maneuverability and stability compared to the correct answer does not exceed and both of those values differ from each other by no more than .