/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here
		BufferedReader r =
            new BufferedReader(new InputStreamReader(System.in), 1);
        String s = r.readLine();
        int size = Integer.parseInt(s);
        long min = 0,max = 0,sum = 0;
        s = r.readLine();
        String[] strData = s.split(" ");
        for (int count = 0; count < size; count++){
        		long tmp = Long.parseLong(strData[count]);
        		if(count == 0){
        			min = max = sum = tmp;
        		} else {
        			if (min > tmp) {
        				min = tmp;
        			}
        			if (max < tmp) {
        				max = tmp;
        			}
        			sum += tmp;
        		}
        }
        System.out.print(min);
        System.out.print(" ");
        System.out.print(max);
        System.out.print(" ");
        System.out.print(sum);
        System.out.print("\n");
    }
} import java.util.*; util.* java import java.lang.*; lang.* java import java.io.*; io.* java class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here
		BufferedReader r =
            new BufferedReader(new InputStreamReader(System.in), 1);
        String s = r.readLine();
        int size = Integer.parseInt(s);
        long min = 0,max = 0,sum = 0;
        s = r.readLine();
        String[] strData = s.split(" ");
        for (int count = 0; count < size; count++){
        		long tmp = Long.parseLong(strData[count]);
        		if(count == 0){
        			min = max = sum = tmp;
        		} else {
        			if (min > tmp) {
        				min = tmp;
        			}
        			if (max < tmp) {
        				max = tmp;
        			}
        			sum += tmp;
        		}
        }
        System.out.print(min);
        System.out.print(" ");
        System.out.print(max);
        System.out.print(" ");
        System.out.print(sum);
        System.out.print("\n");
    }
} Main public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here
		BufferedReader r =
            new BufferedReader(new InputStreamReader(System.in), 1);
        String s = r.readLine();
        int size = Integer.parseInt(s);
        long min = 0,max = 0,sum = 0;
        s = r.readLine();
        String[] strData = s.split(" ");
        for (int count = 0; count < size; count++){
        		long tmp = Long.parseLong(strData[count]);
        		if(count == 0){
        			min = max = sum = tmp;
        		} else {
        			if (min > tmp) {
        				min = tmp;
        			}
        			if (max < tmp) {
        				max = tmp;
        			}
        			sum += tmp;
        		}
        }
        System.out.print(min);
        System.out.print(" ");
        System.out.print(max);
        System.out.print(" ");
        System.out.print(sum);
        System.out.print("\n");
    } main {
		// your code goes here
		BufferedReader r =
            new BufferedReader(new InputStreamReader(System.in), 1);
        String s = r.readLine();
        int size = Integer.parseInt(s);
        long min = 0,max = 0,sum = 0;
        s = r.readLine();
        String[] strData = s.split(" ");
        for (int count = 0; count < size; count++){
        		long tmp = Long.parseLong(strData[count]);
        		if(count == 0){
        			min = max = sum = tmp;
        		} else {
        			if (min > tmp) {
        				min = tmp;
        			}
        			if (max < tmp) {
        				max = tmp;
        			}
        			sum += tmp;
        		}
        }
        System.out.print(min);
        System.out.print(" ");
        System.out.print(max);
        System.out.print(" ");
        System.out.print(sum);
        System.out.print("\n");
    } BufferedReader r =
            new BufferedReader(new InputStreamReader(System.in), 1); r new BufferedReader(new InputStreamReader(System.in), 1) String s = r.readLine(); s r.readLine() r.readLine r int size = Integer.parseInt(s); size Integer.parseInt(s) Integer.parseInt Integer s long min = 0 min 0 max = 0 max 0 sum = 0; sum 0 s = r.readLine() s r.readLine() r.readLine r String[] strData = s.split(" "); strData s.split(" ") s.split s " " for (int count = 0; count < size; count++){
        		long tmp = Long.parseLong(strData[count]);
        		if(count == 0){
        			min = max = sum = tmp;
        		} else {
        			if (min > tmp) {
        				min = tmp;
        			}
        			if (max < tmp) {
        				max = tmp;
        			}
        			sum += tmp;
        		}
        } int count = 0; int count = 0; count 0 count < size count size count++ count++ count {
        		long tmp = Long.parseLong(strData[count]);
        		if(count == 0){
        			min = max = sum = tmp;
        		} else {
        			if (min > tmp) {
        				min = tmp;
        			}
        			if (max < tmp) {
        				max = tmp;
        			}
        			sum += tmp;
        		}
        } {
        		long tmp = Long.parseLong(strData[count]);
        		if(count == 0){
        			min = max = sum = tmp;
        		} else {
        			if (min > tmp) {
        				min = tmp;
        			}
        			if (max < tmp) {
        				max = tmp;
        			}
        			sum += tmp;
        		}
        } long tmp = Long.parseLong(strData[count]); tmp Long.parseLong(strData[count]) Long.parseLong Long strData[count] strData count if(count == 0){
        			min = max = sum = tmp;
        		} else {
        			if (min > tmp) {
        				min = tmp;
        			}
        			if (max < tmp) {
        				max = tmp;
        			}
        			sum += tmp;
        		} count == 0 count 0 {
        			min = max = sum = tmp;
        		} min = max = sum = tmp min max = sum = tmp max sum = tmp sum tmp {
        			if (min > tmp) {
        				min = tmp;
        			}
        			if (max < tmp) {
        				max = tmp;
        			}
        			sum += tmp;
        		} if (min > tmp) {
        				min = tmp;
        			} min > tmp min tmp {
        				min = tmp;
        			} min = tmp min tmp if (max < tmp) {
        				max = tmp;
        			} max < tmp max tmp {
        				max = tmp;
        			} max = tmp max tmp sum += tmp sum tmp System.out.print(min) System.out.print System.out System System.out min System.out.print(" ") System.out.print System.out System System.out " " System.out.print(max) System.out.print System.out System System.out max System.out.print(" ") System.out.print System.out System System.out " " System.out.print(sum) System.out.print System.out System System.out sum System.out.print("\n") System.out.print System.out System System.out "\n" String[] args args
/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here
		BufferedReader r =
            new BufferedReader(new InputStreamReader(System.in), 1);
        String s = r.readLine();
        int size = Integer.parseInt(s);
        long min = 0,max = 0,sum = 0;
        s = r.readLine();
        String[] strData = s.split(" ");
        for (int count = 0; count < size; count++){
        		long tmp = Long.parseLong(strData[count]);
        		if(count == 0){
        			min = max = sum = tmp;
        		} else {
        			if (min > tmp) {
        				min = tmp;
        			}
        			if (max < tmp) {
        				max = tmp;
        			}
        			sum += tmp;
        		}
        }
        System.out.print(min);
        System.out.print(" ");
        System.out.print(max);
        System.out.print(" ");
        System.out.print(sum);
        System.out.print("\n");
    }
}