import java.util.Scanner;

class Main{
    public static void main(String[] args){
        int n;
        long total = 0;
        //????°???????Constraints????????§?????§?????????
        int min = 1000000;
        //min??¨????§?
        int max = -1000000;
    	//?¨??????\??????????????????????????§????????????
		Scanner scanner = new Scanner(System.in);
		n = scanner.nextInt();
		int a[] = new int[n];
		
		for(int i = 0;i < n;i++){
			a[i] = scanner.nextInt();
			total += a[i];
			
			if(min > a[i]){
				min = a[i];
			}
			
			if(max < a[i]){
				max = a[i];
			}
		}
		
		System.out.println(min+" "+max+" "+total);
    	scanner.close();
    }
} import java.util.Scanner; Scanner java.util class Main{
    public static void main(String[] args){
        int n;
        long total = 0;
        //????°???????Constraints????????§?????§?????????
        int min = 1000000;
        //min??¨????§?
        int max = -1000000;
    	//?¨??????\??????????????????????????§????????????
		Scanner scanner = new Scanner(System.in);
		n = scanner.nextInt();
		int a[] = new int[n];
		
		for(int i = 0;i < n;i++){
			a[i] = scanner.nextInt();
			total += a[i];
			
			if(min > a[i]){
				min = a[i];
			}
			
			if(max < a[i]){
				max = a[i];
			}
		}
		
		System.out.println(min+" "+max+" "+total);
    	scanner.close();
    }
} Main public static void main(String[] args){
        int n;
        long total = 0;
        //????°???????Constraints????????§?????§?????????
        int min = 1000000;
        //min??¨????§?
        int max = -1000000;
    	//?¨??????\??????????????????????????§????????????
		Scanner scanner = new Scanner(System.in);
		n = scanner.nextInt();
		int a[] = new int[n];
		
		for(int i = 0;i < n;i++){
			a[i] = scanner.nextInt();
			total += a[i];
			
			if(min > a[i]){
				min = a[i];
			}
			
			if(max < a[i]){
				max = a[i];
			}
		}
		
		System.out.println(min+" "+max+" "+total);
    	scanner.close();
    } main {
        int n;
        long total = 0;
        //????°???????Constraints????????§?????§?????????
        int min = 1000000;
        //min??¨????§?
        int max = -1000000;
    	//?¨??????\??????????????????????????§????????????
		Scanner scanner = new Scanner(System.in);
		n = scanner.nextInt();
		int a[] = new int[n];
		
		for(int i = 0;i < n;i++){
			a[i] = scanner.nextInt();
			total += a[i];
			
			if(min > a[i]){
				min = a[i];
			}
			
			if(max < a[i]){
				max = a[i];
			}
		}
		
		System.out.println(min+" "+max+" "+total);
    	scanner.close();
    } int n; n long total = 0; total 0 int min = 1000000; min 1000000 int max = -1000000; max -1000000 1000000 Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) n = scanner.nextInt() n scanner.nextInt() scanner.nextInt scanner int a[] = new int[n]; a new int[n] n for(int i = 0;i < n;i++){
			a[i] = scanner.nextInt();
			total += a[i];
			
			if(min > a[i]){
				min = a[i];
			}
			
			if(max < a[i]){
				max = a[i];
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			a[i] = scanner.nextInt();
			total += a[i];
			
			if(min > a[i]){
				min = a[i];
			}
			
			if(max < a[i]){
				max = a[i];
			}
		} {
			a[i] = scanner.nextInt();
			total += a[i];
			
			if(min > a[i]){
				min = a[i];
			}
			
			if(max < a[i]){
				max = a[i];
			}
		} a[i] = scanner.nextInt() a[i] a i scanner.nextInt() scanner.nextInt scanner total += a[i] total a[i] a i if(min > a[i]){
				min = a[i];
			} min > a[i] min a[i] a i {
				min = a[i];
			} min = a[i] min a[i] a i if(max < a[i]){
				max = a[i];
			} max < a[i] max a[i] a i {
				max = a[i];
			} max = a[i] max a[i] a i System.out.println(min+" "+max+" "+total) System.out.println System.out System System.out min+" "+max+" "+total " " max min+" "+max+" "+total min " " max " " total scanner.close() scanner.close scanner String[] args args
import java.util.Scanner;

class Main{
    public static void main(String[] args){
        int n;
        long total = 0;
        //????°???????Constraints????????§?????§?????????
        int min = 1000000;
        //min??¨????§?
        int max = -1000000;
    	//?¨??????\??????????????????????????§????????????
		Scanner scanner = new Scanner(System.in);
		n = scanner.nextInt();
		int a[] = new int[n];
		
		for(int i = 0;i < n;i++){
			a[i] = scanner.nextInt();
			total += a[i];
			
			if(min > a[i]){
				min = a[i];
			}
			
			if(max < a[i]){
				max = a[i];
			}
		}
		
		System.out.println(min+" "+max+" "+total);
    	scanner.close();
    }
}