New Evaluation Rules
Mathematics teacher L.I. is renowned for her democratic approach to grading students. Starting from September 1st this year, she has implemented new grading rules for students presenting their essays on the history of mathematics. Each presentation is evaluated by all the students in the class, with each student assigning a score between 1 and 100 (L.I. uses a 100-point grading system). To ensure fairness, L.I. discards the lowest and highest scores.
To streamline the calculation of the presentation results, L.I. has asked you to create a program that will demonstrate the grading process.
The program should output the N scores given by the students, maintaining their original order, and then display their sum, with the scores that are excluded from the sum calculation enclosed in parentheses.
Input format:
The first line of the input file contains the number N (3 ≤ N ≤ 35), which represents the number of students who evaluated the presentation. The second line contains N numbers, which are the scores given by the students.
Output format:
Output the scores in the same order as they appear in the input, enclosing the minimum score (and if there are multiple, the leftmost one) and the maximum score (and if there are multiple, the rightmost one) in parentheses. Then, display the sum of all scores not enclosed in parentheses. All numbers, including the sum, should be printed on one line, separated by a single space, with no spaces inside the parentheses. An equals sign should precede the sum, with a single space on either side. The order of the scores should remain as in the input data.