Write a program which reads a sequence of $n$ integers $a_i (i = 1, 2, ... n)$, and prints the minimum value, maximum value and sum of the sequence.

Constraints

* $0 < n \leq 10000$
* $-1000000 \leq a_i \leq 1000000$

Input

In the first line, an integer $n$ is given. In the next line, $n$ integers $a_i$ are given in a line.

Output

Print the minimum value, maximum value and sum in a line. Put a single space between the values.

Example

Input

5
10 1 5 4 17


Output

1 17 37
import sys

def main():
    lines = sys.stdin.readlines()

    n_max = 0
    sum_var = 0
    min_var = 0
    max_var = 0
    for index, line in enumerate(lines):
        if index == 0:
            line = line.strip('\n')
            n_max = int(line)
            # print(n_max)
        elif index == 1:
            line = line.strip('\n')
            elems = line.split(" ")
            min_var = int(elems[0]) # put a value of first elem as minimum num.
            max_var = int(elems[0])
            for elem in elems:
                elem = int(elem)
                if elem < min_var:
                    min_var = elem
                if elem > max_var:
                    max_var = elem
                sum_var += elem

    print min_var, max_var, sum_var

if __name__ == "__main__":
    main()