import java.util.Scanner;

class Main{
    public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
    	int n = scan.nextInt();
    	long[] values = new long[n];

        for(int i = 0; i < n; i++){
        	values[i] = scan.nextInt();
        }

        long min = values[0];
        long max = values[0];
        long sum = 0;

        for(int i = 0; i < values.length; i++){
        	if(min > values[i]){
        		min = values[i];
        	}
        	if(max < values[i]){
        		max = values[i];
        	}
        	sum += values[i];
        }
        System.out.printf("%d %d %d\n", min,max,sum);
    }
} import java.util.Scanner; Scanner java.util class Main{
    public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
    	int n = scan.nextInt();
    	long[] values = new long[n];

        for(int i = 0; i < n; i++){
        	values[i] = scan.nextInt();
        }

        long min = values[0];
        long max = values[0];
        long sum = 0;

        for(int i = 0; i < values.length; i++){
        	if(min > values[i]){
        		min = values[i];
        	}
        	if(max < values[i]){
        		max = values[i];
        	}
        	sum += values[i];
        }
        System.out.printf("%d %d %d\n", min,max,sum);
    }
} Main public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
    	int n = scan.nextInt();
    	long[] values = new long[n];

        for(int i = 0; i < n; i++){
        	values[i] = scan.nextInt();
        }

        long min = values[0];
        long max = values[0];
        long sum = 0;

        for(int i = 0; i < values.length; i++){
        	if(min > values[i]){
        		min = values[i];
        	}
        	if(max < values[i]){
        		max = values[i];
        	}
        	sum += values[i];
        }
        System.out.printf("%d %d %d\n", min,max,sum);
    } main {
    	Scanner scan = new Scanner(System.in);
    	int n = scan.nextInt();
    	long[] values = new long[n];

        for(int i = 0; i < n; i++){
        	values[i] = scan.nextInt();
        }

        long min = values[0];
        long max = values[0];
        long sum = 0;

        for(int i = 0; i < values.length; i++){
        	if(min > values[i]){
        		min = values[i];
        	}
        	if(max < values[i]){
        		max = values[i];
        	}
        	sum += values[i];
        }
        System.out.printf("%d %d %d\n", min,max,sum);
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan long[] values = new long[n]; values new long[n] n for(int i = 0; i < n; i++){
        	values[i] = scan.nextInt();
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
        	values[i] = scan.nextInt();
        } {
        	values[i] = scan.nextInt();
        } values[i] = scan.nextInt() values[i] values i scan.nextInt() scan.nextInt scan long min = values[0]; min values[0] values 0 long max = values[0]; max values[0] values 0 long sum = 0; sum 0 for(int i = 0; i < values.length; i++){
        	if(min > values[i]){
        		min = values[i];
        	}
        	if(max < values[i]){
        		max = values[i];
        	}
        	sum += values[i];
        } int i = 0; int i = 0; i 0 i < values.length i values.length values values.length i++ i++ i {
        	if(min > values[i]){
        		min = values[i];
        	}
        	if(max < values[i]){
        		max = values[i];
        	}
        	sum += values[i];
        } {
        	if(min > values[i]){
        		min = values[i];
        	}
        	if(max < values[i]){
        		max = values[i];
        	}
        	sum += values[i];
        } if(min > values[i]){
        		min = values[i];
        	} min > values[i] min values[i] values i {
        		min = values[i];
        	} min = values[i] min values[i] values i if(max < values[i]){
        		max = values[i];
        	} max < values[i] max values[i] values i {
        		max = values[i];
        	} max = values[i] max values[i] values i sum += values[i] sum values[i] values i System.out.printf("%d %d %d\n", min,max,sum) System.out.printf System.out System System.out "%d %d %d\n" min max sum String[] args args
import java.util.Scanner;

class Main{
    public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
    	int n = scan.nextInt();
    	long[] values = new long[n];

        for(int i = 0; i < n; i++){
        	values[i] = scan.nextInt();
        }

        long min = values[0];
        long max = values[0];
        long sum = 0;

        for(int i = 0; i < values.length; i++){
        	if(min > values[i]){
        		min = values[i];
        	}
        	if(max < values[i]){
        		max = values[i];
        	}
        	sum += values[i];
        }
        System.out.printf("%d %d %d\n", min,max,sum);
    }
}