import java.util.Scanner;

public class Main {
    public static void main(String[] args) {

        // ??????????????????????????????.
        // ?????°????????????????¢??????????.
        // ?????????????´????????´???????.
        Scanner sc = new Scanner(System.in);
        int count = sc.nextInt();
        int array[] = new int[count];
        for (int i = 0; i < count; i ++) {
            array[i] = sc.nextInt();
        }


        // ????°???????????????????.
        // ?????§??????????????????.
        // ????¨???????????????????.
        long min = 1000001;
        for (int i = 0; i < count; i ++) {
            if (min > array[i]) { min = array[i]; }
        }
        long max = -1000001;
        for (int i = 0; i < count; i ++) {
            if (max < array[i]) { max = array[i]; }
        }
        long sum = 0;
        for (int i = 0; i < count; i ++) { sum += array[i]; }
        System.out.println(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 count = sc.nextInt();
        int array[] = new int[count];
        for (int i = 0; i < count; i ++) {
            array[i] = sc.nextInt();
        }


        // ????°???????????????????.
        // ?????§??????????????????.
        // ????¨???????????????????.
        long min = 1000001;
        for (int i = 0; i < count; i ++) {
            if (min > array[i]) { min = array[i]; }
        }
        long max = -1000001;
        for (int i = 0; i < count; i ++) {
            if (max < array[i]) { max = array[i]; }
        }
        long sum = 0;
        for (int i = 0; i < count; i ++) { sum += array[i]; }
        System.out.println(min + " " + max + " " + sum);
    }
} Main public static void main(String[] args) {

        // ??????????????????????????????.
        // ?????°????????????????¢??????????.
        // ?????????????´????????´???????.
        Scanner sc = new Scanner(System.in);
        int count = sc.nextInt();
        int array[] = new int[count];
        for (int i = 0; i < count; i ++) {
            array[i] = sc.nextInt();
        }


        // ????°???????????????????.
        // ?????§??????????????????.
        // ????¨???????????????????.
        long min = 1000001;
        for (int i = 0; i < count; i ++) {
            if (min > array[i]) { min = array[i]; }
        }
        long max = -1000001;
        for (int i = 0; i < count; i ++) {
            if (max < array[i]) { max = array[i]; }
        }
        long sum = 0;
        for (int i = 0; i < count; i ++) { sum += array[i]; }
        System.out.println(min + " " + max + " " + sum);
    } main {

        // ??????????????????????????????.
        // ?????°????????????????¢??????????.
        // ?????????????´????????´???????.
        Scanner sc = new Scanner(System.in);
        int count = sc.nextInt();
        int array[] = new int[count];
        for (int i = 0; i < count; i ++) {
            array[i] = sc.nextInt();
        }


        // ????°???????????????????.
        // ?????§??????????????????.
        // ????¨???????????????????.
        long min = 1000001;
        for (int i = 0; i < count; i ++) {
            if (min > array[i]) { min = array[i]; }
        }
        long max = -1000001;
        for (int i = 0; i < count; i ++) {
            if (max < array[i]) { max = array[i]; }
        }
        long sum = 0;
        for (int i = 0; i < count; i ++) { sum += array[i]; }
        System.out.println(min + " " + max + " " + sum);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int count = sc.nextInt(); count sc.nextInt() sc.nextInt sc int array[] = new int[count]; array new int[count] count for (int i = 0; i < count; i ++) {
            array[i] = sc.nextInt();
        } int i = 0; int i = 0; i 0 i < count i count i ++ i ++ i {
            array[i] = sc.nextInt();
        } {
            array[i] = sc.nextInt();
        } array[i] = sc.nextInt() array[i] array i sc.nextInt() sc.nextInt sc long min = 1000001; min 1000001 for (int i = 0; i < count; i ++) {
            if (min > array[i]) { min = array[i]; }
        } int i = 0; int i = 0; i 0 i < count i count i ++ i ++ i {
            if (min > array[i]) { min = array[i]; }
        } {
            if (min > array[i]) { min = array[i]; }
        } if (min > array[i]) { min = array[i]; } min > array[i] min array[i] array i { min = array[i]; } min = array[i] min array[i] array i long max = -1000001; max -1000001 1000001 for (int i = 0; i < count; i ++) {
            if (max < array[i]) { max = array[i]; }
        } int i = 0; int i = 0; i 0 i < count i count i ++ i ++ i {
            if (max < array[i]) { max = array[i]; }
        } {
            if (max < array[i]) { max = array[i]; }
        } if (max < array[i]) { max = array[i]; } max < array[i] max array[i] array i { max = array[i]; } max = array[i] max array[i] array i long sum = 0; sum 0 for (int i = 0; i < count; i ++) { sum += array[i]; } int i = 0; int i = 0; i 0 i < count i count i ++ i ++ i { sum += array[i]; } { sum += array[i]; } sum += array[i] sum array[i] array i 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 public class Main {
    public static void main(String[] args) {

        // ??????????????????????????????.
        // ?????°????????????????¢??????????.
        // ?????????????´????????´???????.
        Scanner sc = new Scanner(System.in);
        int count = sc.nextInt();
        int array[] = new int[count];
        for (int i = 0; i < count; i ++) {
            array[i] = sc.nextInt();
        }


        // ????°???????????????????.
        // ?????§??????????????????.
        // ????¨???????????????????.
        long min = 1000001;
        for (int i = 0; i < count; i ++) {
            if (min > array[i]) { min = array[i]; }
        }
        long max = -1000001;
        for (int i = 0; i < count; i ++) {
            if (max < array[i]) { max = array[i]; }
        }
        long sum = 0;
        for (int i = 0; i < count; i ++) { sum += array[i]; }
        System.out.println(min + " " + max + " " + sum);
    }
} public class Main {
    public static void main(String[] args) {

        // ??????????????????????????????.
        // ?????°????????????????¢??????????.
        // ?????????????´????????´???????.
        Scanner sc = new Scanner(System.in);
        int count = sc.nextInt();
        int array[] = new int[count];
        for (int i = 0; i < count; i ++) {
            array[i] = sc.nextInt();
        }


        // ????°???????????????????.
        // ?????§??????????????????.
        // ????¨???????????????????.
        long min = 1000001;
        for (int i = 0; i < count; i ++) {
            if (min > array[i]) { min = array[i]; }
        }
        long max = -1000001;
        for (int i = 0; i < count; i ++) {
            if (max < array[i]) { max = array[i]; }
        }
        long sum = 0;
        for (int i = 0; i < count; i ++) { sum += array[i]; }
        System.out.println(min + " " + max + " " + sum);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {

        // ??????????????????????????????.
        // ?????°????????????????¢??????????.
        // ?????????????´????????´???????.
        Scanner sc = new Scanner(System.in);
        int count = sc.nextInt();
        int array[] = new int[count];
        for (int i = 0; i < count; i ++) {
            array[i] = sc.nextInt();
        }


        // ????°???????????????????.
        // ?????§??????????????????.
        // ????¨???????????????????.
        long min = 1000001;
        for (int i = 0; i < count; i ++) {
            if (min > array[i]) { min = array[i]; }
        }
        long max = -1000001;
        for (int i = 0; i < count; i ++) {
            if (max < array[i]) { max = array[i]; }
        }
        long sum = 0;
        for (int i = 0; i < count; i ++) { sum += array[i]; }
        System.out.println(min + " " + max + " " + sum);
    }
}