Олимпиадный тренинг

Задача 38221. ski jumping


In ski jumping competitions, jumping technique is judged by five judges. Each judge gives a score from 1 to 20, after which one lowest and one highest score is discarded. You need to write a program that will display the results of the jump for a TV broadcast.

It should display the five scores given by the judges without changing their order, and then their sum, and at the same time take into brackets those marks that are not taken into account when calculating the sum

Input
The input is 5 natural numbers from 1 to 20, separated by a space.

Imprint
Print the same numbers in the same order, putting in brackets the minimum (and if there are several – the leftmost of them) and the maximum (and if there are several – the rightmost of them) number, as well as the sum of all numbers not taken in brackets. All numbers (including the sum) must be printed on one line and separated by one space (there must be no spaces inside the brackets). The amount must be preceded by an equals sign, separated on the left and right by a single space. The order of the scores must be the same as in the input.
Examples
# Input Output
1 1 2 3 4 5 (1) 2 3 4 (5) = 9
2 10 11 10 11 10 (10) 11 10 (11) 10 = 31