import java.util.Scanner;
import java.util.Arrays;

public class Main {

    public static void main(String[] args) throws Exception {
        Scanner input = new Scanner(System.in);
        int[] array = new int[input.nextInt()];
        long total = 0;
        for(int i = 0; i < array.length; i++){
            array[i] = input.nextInt();
            total += array[i];
        }
        Arrays.sort(array);
        System.out.println(array[0]+" "+array[array.length-1]+" "+total);
    }
} import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays java.util public class Main {

    public static void main(String[] args) throws Exception {
        Scanner input = new Scanner(System.in);
        int[] array = new int[input.nextInt()];
        long total = 0;
        for(int i = 0; i < array.length; i++){
            array[i] = input.nextInt();
            total += array[i];
        }
        Arrays.sort(array);
        System.out.println(array[0]+" "+array[array.length-1]+" "+total);
    }
} Main public static void main(String[] args) throws Exception {
        Scanner input = new Scanner(System.in);
        int[] array = new int[input.nextInt()];
        long total = 0;
        for(int i = 0; i < array.length; i++){
            array[i] = input.nextInt();
            total += array[i];
        }
        Arrays.sort(array);
        System.out.println(array[0]+" "+array[array.length-1]+" "+total);
    } main {
        Scanner input = new Scanner(System.in);
        int[] array = new int[input.nextInt()];
        long total = 0;
        for(int i = 0; i < array.length; i++){
            array[i] = input.nextInt();
            total += array[i];
        }
        Arrays.sort(array);
        System.out.println(array[0]+" "+array[array.length-1]+" "+total);
    } Scanner input = new Scanner(System.in); input new Scanner(System.in) int[] array = new int[input.nextInt()]; array new int[input.nextInt()] input.nextInt() input.nextInt input long total = 0; total 0 for(int i = 0; i < array.length; i++){
            array[i] = input.nextInt();
            total += array[i];
        } int i = 0; int i = 0; i 0 i < array.length i array.length array array.length i++ i++ i {
            array[i] = input.nextInt();
            total += array[i];
        } {
            array[i] = input.nextInt();
            total += array[i];
        } array[i] = input.nextInt() array[i] array i input.nextInt() input.nextInt input total += array[i] total array[i] array i Arrays.sort(array) Arrays.sort Arrays array System.out.println(array[0]+" "+array[array.length-1]+" "+total) System.out.println System.out System System.out array[0]+" "+array[array.length-1]+" "+total " " array[array.length-1] array[0]+" "+array[array.length-1]+" "+total array[0] array 0 " " array[array.length-1] array array.length-1 array.length array array.length 1 " " total String[] args args public class Main {

    public static void main(String[] args) throws Exception {
        Scanner input = new Scanner(System.in);
        int[] array = new int[input.nextInt()];
        long total = 0;
        for(int i = 0; i < array.length; i++){
            array[i] = input.nextInt();
            total += array[i];
        }
        Arrays.sort(array);
        System.out.println(array[0]+" "+array[array.length-1]+" "+total);
    }
} public class Main {

    public static void main(String[] args) throws Exception {
        Scanner input = new Scanner(System.in);
        int[] array = new int[input.nextInt()];
        long total = 0;
        for(int i = 0; i < array.length; i++){
            array[i] = input.nextInt();
            total += array[i];
        }
        Arrays.sort(array);
        System.out.println(array[0]+" "+array[array.length-1]+" "+total);
    }
} Main
import java.util.Scanner;
import java.util.Arrays;

public class Main {

    public static void main(String[] args) throws Exception {
        Scanner input = new Scanner(System.in);
        int[] array = new int[input.nextInt()];
        long total = 0;
        for(int i = 0; i < array.length; i++){
            array[i] = input.nextInt();
            total += array[i];
        }
        Arrays.sort(array);
        System.out.println(array[0]+" "+array[array.length-1]+" "+total);
    }
}