import java.util.Scanner;

public class Main {

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long sum = sc.nextInt();
        int min = (int)sum,max = (int)sum;
        for(int i = 1;i < n;++i){
            int a = sc.nextInt();
            if(max < a) max = a;
            else if(a < min) min = a;
            sum += a;
        }
        System.out.printf("%d %d %d\n",min,max,sum);
    }

} 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 sum = sc.nextInt();
        int min = (int)sum,max = (int)sum;
        for(int i = 1;i < n;++i){
            int a = sc.nextInt();
            if(max < a) max = a;
            else if(a < min) min = a;
            sum += a;
        }
        System.out.printf("%d %d %d\n",min,max,sum);
    }

} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long sum = sc.nextInt();
        int min = (int)sum,max = (int)sum;
        for(int i = 1;i < n;++i){
            int a = sc.nextInt();
            if(max < a) max = a;
            else if(a < min) min = a;
            sum += a;
        }
        System.out.printf("%d %d %d\n",min,max,sum);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long sum = sc.nextInt();
        int min = (int)sum,max = (int)sum;
        for(int i = 1;i < n;++i){
            int a = sc.nextInt();
            if(max < a) max = a;
            else if(a < min) min = a;
            sum += a;
        }
        System.out.printf("%d %d %d\n",min,max,sum);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc long sum = sc.nextInt(); sum sc.nextInt() sc.nextInt sc int min = (int)sum min (int)sum max = (int)sum; max (int)sum for(int i = 1;i < n;++i){
            int a = sc.nextInt();
            if(max < a) max = a;
            else if(a < min) min = a;
            sum += a;
        } int i = 1; int i = 1; i 1 i < n i n ++i ++i i {
            int a = sc.nextInt();
            if(max < a) max = a;
            else if(a < min) min = a;
            sum += a;
        } {
            int a = sc.nextInt();
            if(max < a) max = a;
            else if(a < min) min = a;
            sum += a;
        } int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc if(max < a) max = a;
            else if(a < min) min = 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.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 public class Main {

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long sum = sc.nextInt();
        int min = (int)sum,max = (int)sum;
        for(int i = 1;i < n;++i){
            int a = sc.nextInt();
            if(max < a) max = a;
            else if(a < min) min = a;
            sum += a;
        }
        System.out.printf("%d %d %d\n",min,max,sum);
    }

} public class Main {

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long sum = sc.nextInt();
        int min = (int)sum,max = (int)sum;
        for(int i = 1;i < n;++i){
            int a = sc.nextInt();
            if(max < a) max = a;
            else if(a < min) min = a;
            sum += a;
        }
        System.out.printf("%d %d %d\n",min,max,sum);
    }

} 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 sum = sc.nextInt();
        int min = (int)sum,max = (int)sum;
        for(int i = 1;i < n;++i){
            int a = sc.nextInt();
            if(max < a) max = a;
            else if(a < min) min = a;
            sum += a;
        }
        System.out.printf("%d %d %d\n",min,max,sum);
    }

}