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

