import java.util.Arrays;
import java.util.Scanner;
class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        long sum = 0;
        
        int nl[] = new int[n];
        for (int i=0; i<n; i++) {
            nl[i] = sc.nextInt();
            sum = sum +nl[i];
        }
        
        Arrays.sort(nl);
        
        System.out.println(nl[0]+" "+nl[n-1]+" "+sum);
    }
    
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        long sum = 0;
        
        int nl[] = new int[n];
        for (int i=0; i<n; i++) {
            nl[i] = sc.nextInt();
            sum = sum +nl[i];
        }
        
        Arrays.sort(nl);
        
        System.out.println(nl[0]+" "+nl[n-1]+" "+sum);
    }
    
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        long sum = 0;
        
        int nl[] = new int[n];
        for (int i=0; i<n; i++) {
            nl[i] = sc.nextInt();
            sum = sum +nl[i];
        }
        
        Arrays.sort(nl);
        
        System.out.println(nl[0]+" "+nl[n-1]+" "+sum);
    } main {
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        long sum = 0;
        
        int nl[] = new int[n];
        for (int i=0; i<n; i++) {
            nl[i] = sc.nextInt();
            sum = sum +nl[i];
        }
        
        Arrays.sort(nl);
        
        System.out.println(nl[0]+" "+nl[n-1]+" "+sum);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc long sum = 0; sum 0 int nl[] = new int[n]; nl new int[n] n for (int i=0; i<n; i++) {
            nl[i] = sc.nextInt();
            sum = sum +nl[i];
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            nl[i] = sc.nextInt();
            sum = sum +nl[i];
        } {
            nl[i] = sc.nextInt();
            sum = sum +nl[i];
        } nl[i] = sc.nextInt() nl[i] nl i sc.nextInt() sc.nextInt sc sum = sum +nl[i] sum sum +nl[i] sum nl[i] nl i Arrays.sort(nl) Arrays.sort Arrays nl System.out.println(nl[0]+" "+nl[n-1]+" "+sum) System.out.println System.out System System.out nl[0]+" "+nl[n-1]+" "+sum " " nl[n-1] nl[0]+" "+nl[n-1]+" "+sum nl[0] nl 0 " " nl[n-1] nl n-1 n 1 " " sum String[] args args
import java.util.Arrays;
import java.util.Scanner;
class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        long sum = 0;
        
        int nl[] = new int[n];
        for (int i=0; i<n; i++) {
            nl[i] = sc.nextInt();
            sum = sum +nl[i];
        }
        
        Arrays.sort(nl);
        
        System.out.println(nl[0]+" "+nl[n-1]+" "+sum);
    }
    
}