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