import java.util.Scanner;

public class Main {


    public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
    	long sum = 0, max = -1000000, min = 1000000;
    	int n = scan.nextInt();
    	long a[] = new long[n]; 
    	for(int cnt = 0; cnt < n; cnt++){
    		a[cnt] = scan.nextLong();
    		if(a[cnt] < min)
    			min = a[cnt];
    		if(a[cnt] > max)
    			max = a[cnt];
    		sum += a[cnt];
    	}		
        System.out.println(min + " " + max + " " + sum);
        scan.close();
    }

} import java.util.Scanner; Scanner java.util public class Main {


    public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
    	long sum = 0, max = -1000000, min = 1000000;
    	int n = scan.nextInt();
    	long a[] = new long[n]; 
    	for(int cnt = 0; cnt < n; cnt++){
    		a[cnt] = scan.nextLong();
    		if(a[cnt] < min)
    			min = a[cnt];
    		if(a[cnt] > max)
    			max = a[cnt];
    		sum += a[cnt];
    	}		
        System.out.println(min + " " + max + " " + sum);
        scan.close();
    }

} Main public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
    	long sum = 0, max = -1000000, min = 1000000;
    	int n = scan.nextInt();
    	long a[] = new long[n]; 
    	for(int cnt = 0; cnt < n; cnt++){
    		a[cnt] = scan.nextLong();
    		if(a[cnt] < min)
    			min = a[cnt];
    		if(a[cnt] > max)
    			max = a[cnt];
    		sum += a[cnt];
    	}		
        System.out.println(min + " " + max + " " + sum);
        scan.close();
    } main {
    	Scanner scan = new Scanner(System.in);
    	long sum = 0, max = -1000000, min = 1000000;
    	int n = scan.nextInt();
    	long a[] = new long[n]; 
    	for(int cnt = 0; cnt < n; cnt++){
    		a[cnt] = scan.nextLong();
    		if(a[cnt] < min)
    			min = a[cnt];
    		if(a[cnt] > max)
    			max = a[cnt];
    		sum += a[cnt];
    	}		
        System.out.println(min + " " + max + " " + sum);
        scan.close();
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) long sum = 0 sum 0 max = -1000000 max -1000000 1000000 min = 1000000; min 1000000 int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan long a[] = new long[n]; a new long[n] n for(int cnt = 0; cnt < n; cnt++){
    		a[cnt] = scan.nextLong();
    		if(a[cnt] < min)
    			min = a[cnt];
    		if(a[cnt] > max)
    			max = a[cnt];
    		sum += a[cnt];
    	} int cnt = 0; int cnt = 0; cnt 0 cnt < n cnt n cnt++ cnt++ cnt {
    		a[cnt] = scan.nextLong();
    		if(a[cnt] < min)
    			min = a[cnt];
    		if(a[cnt] > max)
    			max = a[cnt];
    		sum += a[cnt];
    	} {
    		a[cnt] = scan.nextLong();
    		if(a[cnt] < min)
    			min = a[cnt];
    		if(a[cnt] > max)
    			max = a[cnt];
    		sum += a[cnt];
    	} a[cnt] = scan.nextLong() a[cnt] a cnt scan.nextLong() scan.nextLong scan if(a[cnt] < min)
    			min = a[cnt]; a[cnt] < min a[cnt] a cnt min min = a[cnt] min a[cnt] a cnt if(a[cnt] > max)
    			max = a[cnt]; a[cnt] > max a[cnt] a cnt max max = a[cnt] max a[cnt] a cnt sum += a[cnt] sum a[cnt] a cnt System.out.println(min + " " + max + " " + sum) System.out.println System.out System System.out min + " " + max + " " + sum " " max min + " " + max + " " + sum min " " max " " sum scan.close() scan.close scan String[] args args public class Main {


    public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
    	long sum = 0, max = -1000000, min = 1000000;
    	int n = scan.nextInt();
    	long a[] = new long[n]; 
    	for(int cnt = 0; cnt < n; cnt++){
    		a[cnt] = scan.nextLong();
    		if(a[cnt] < min)
    			min = a[cnt];
    		if(a[cnt] > max)
    			max = a[cnt];
    		sum += a[cnt];
    	}		
        System.out.println(min + " " + max + " " + sum);
        scan.close();
    }

} public class Main {


    public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
    	long sum = 0, max = -1000000, min = 1000000;
    	int n = scan.nextInt();
    	long a[] = new long[n]; 
    	for(int cnt = 0; cnt < n; cnt++){
    		a[cnt] = scan.nextLong();
    		if(a[cnt] < min)
    			min = a[cnt];
    		if(a[cnt] > max)
    			max = a[cnt];
    		sum += a[cnt];
    	}		
        System.out.println(min + " " + max + " " + sum);
        scan.close();
    }

} Main
import java.util.Scanner;

public class Main {


    public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
    	long sum = 0, max = -1000000, min = 1000000;
    	int n = scan.nextInt();
    	long a[] = new long[n]; 
    	for(int cnt = 0; cnt < n; cnt++){
    		a[cnt] = scan.nextLong();
    		if(a[cnt] < min)
    			min = a[cnt];
    		if(a[cnt] > max)
    			max = a[cnt];
    		sum += a[cnt];
    	}		
        System.out.println(min + " " + max + " " + sum);
        scan.close();
    }

}