import java.text.DecimalFormat;
import java.util.*;

public class Main {
    public static void main(String[] args)  throws java.io.IOException{
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] dataset = new int[n];
        for (int i=0;i<n;i++){
            dataset[i] =  sc.nextInt();
        }
        sc.close();
        long sum = 0;

        for (int elem : dataset){
            sum += elem;
        }
        Arrays.sort(dataset);
        System.out.println(dataset[0] + " " +  dataset[dataset.length-1]+ " "+sum);
    }
} import java.text.DecimalFormat; DecimalFormat java.text import java.util.*; util.* java public class Main {
    public static void main(String[] args)  throws java.io.IOException{
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] dataset = new int[n];
        for (int i=0;i<n;i++){
            dataset[i] =  sc.nextInt();
        }
        sc.close();
        long sum = 0;

        for (int elem : dataset){
            sum += elem;
        }
        Arrays.sort(dataset);
        System.out.println(dataset[0] + " " +  dataset[dataset.length-1]+ " "+sum);
    }
} Main public static void main(String[] args)  throws java.io.IOException{
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] dataset = new int[n];
        for (int i=0;i<n;i++){
            dataset[i] =  sc.nextInt();
        }
        sc.close();
        long sum = 0;

        for (int elem : dataset){
            sum += elem;
        }
        Arrays.sort(dataset);
        System.out.println(dataset[0] + " " +  dataset[dataset.length-1]+ " "+sum);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] dataset = new int[n];
        for (int i=0;i<n;i++){
            dataset[i] =  sc.nextInt();
        }
        sc.close();
        long sum = 0;

        for (int elem : dataset){
            sum += elem;
        }
        Arrays.sort(dataset);
        System.out.println(dataset[0] + " " +  dataset[dataset.length-1]+ " "+sum);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int[] dataset = new int[n]; dataset new int[n] n for (int i=0;i<n;i++){
            dataset[i] =  sc.nextInt();
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            dataset[i] =  sc.nextInt();
        } {
            dataset[i] =  sc.nextInt();
        } dataset[i] =  sc.nextInt() dataset[i] dataset i sc.nextInt() sc.nextInt sc sc.close() sc.close sc long sum = 0; sum 0 for (int elem : dataset){
            sum += elem;
        } int elem dataset {
            sum += elem;
        } {
            sum += elem;
        } sum += elem sum elem Arrays.sort(dataset) Arrays.sort Arrays dataset System.out.println(dataset[0] + " " +  dataset[dataset.length-1]+ " "+sum) System.out.println System.out System System.out dataset[0] + " " +  dataset[dataset.length-1]+ " "+sum " " dataset[dataset.length-1] dataset[0] + " " +  dataset[dataset.length-1]+ " "+sum dataset[0] dataset 0 " " dataset[dataset.length-1] dataset dataset.length-1 dataset.length dataset dataset.length 1 " " sum String[] args args public class Main {
    public static void main(String[] args)  throws java.io.IOException{
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] dataset = new int[n];
        for (int i=0;i<n;i++){
            dataset[i] =  sc.nextInt();
        }
        sc.close();
        long sum = 0;

        for (int elem : dataset){
            sum += elem;
        }
        Arrays.sort(dataset);
        System.out.println(dataset[0] + " " +  dataset[dataset.length-1]+ " "+sum);
    }
} public class Main {
    public static void main(String[] args)  throws java.io.IOException{
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] dataset = new int[n];
        for (int i=0;i<n;i++){
            dataset[i] =  sc.nextInt();
        }
        sc.close();
        long sum = 0;

        for (int elem : dataset){
            sum += elem;
        }
        Arrays.sort(dataset);
        System.out.println(dataset[0] + " " +  dataset[dataset.length-1]+ " "+sum);
    }
} Main
import java.text.DecimalFormat;
import java.util.*;

public class Main {
    public static void main(String[] args)  throws java.io.IOException{
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] dataset = new int[n];
        for (int i=0;i<n;i++){
            dataset[i] =  sc.nextInt();
        }
        sc.close();
        long sum = 0;

        for (int elem : dataset){
            sum += elem;
        }
        Arrays.sort(dataset);
        System.out.println(dataset[0] + " " +  dataset[dataset.length-1]+ " "+sum);
    }
}