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

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????

		Scanner scan = new Scanner(System.in);
		int X = scan.nextInt();
        int[] n = new int[X];
        long sum = 0;
        for(int i = 0; i < X; i++){
        	n[i] = scan.nextInt();
        	sum = sum + n[i];
        }

        // ?????????????????????????????????
        Arrays.sort(n);

        // ?????????????????????
        System.out.print(String.format("%d", n[0]));
        System.out.print(" ");
        System.out.print(String.format("%d", n[X-1]));
        System.out.println(" " + sum);
	}

} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????

		Scanner scan = new Scanner(System.in);
		int X = scan.nextInt();
        int[] n = new int[X];
        long sum = 0;
        for(int i = 0; i < X; i++){
        	n[i] = scan.nextInt();
        	sum = sum + n[i];
        }

        // ?????????????????????????????????
        Arrays.sort(n);

        // ?????????????????????
        System.out.print(String.format("%d", n[0]));
        System.out.print(" ");
        System.out.print(String.format("%d", n[X-1]));
        System.out.println(" " + sum);
	}

} Main public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????

		Scanner scan = new Scanner(System.in);
		int X = scan.nextInt();
        int[] n = new int[X];
        long sum = 0;
        for(int i = 0; i < X; i++){
        	n[i] = scan.nextInt();
        	sum = sum + n[i];
        }

        // ?????????????????????????????????
        Arrays.sort(n);

        // ?????????????????????
        System.out.print(String.format("%d", n[0]));
        System.out.print(" ");
        System.out.print(String.format("%d", n[X-1]));
        System.out.println(" " + sum);
	} main {
		// TODO ?????????????????????????????????????????????

		Scanner scan = new Scanner(System.in);
		int X = scan.nextInt();
        int[] n = new int[X];
        long sum = 0;
        for(int i = 0; i < X; i++){
        	n[i] = scan.nextInt();
        	sum = sum + n[i];
        }

        // ?????????????????????????????????
        Arrays.sort(n);

        // ?????????????????????
        System.out.print(String.format("%d", n[0]));
        System.out.print(" ");
        System.out.print(String.format("%d", n[X-1]));
        System.out.println(" " + sum);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int X = scan.nextInt(); X scan.nextInt() scan.nextInt scan int[] n = new int[X]; n new int[X] X long sum = 0; sum 0 for(int i = 0; i < X; i++){
        	n[i] = scan.nextInt();
        	sum = sum + n[i];
        } int i = 0; int i = 0; i 0 i < X i X i++ i++ i {
        	n[i] = scan.nextInt();
        	sum = sum + n[i];
        } {
        	n[i] = scan.nextInt();
        	sum = sum + n[i];
        } n[i] = scan.nextInt() n[i] n i scan.nextInt() scan.nextInt scan sum = sum + n[i] sum sum + n[i] sum n[i] n i Arrays.sort(n) Arrays.sort Arrays n System.out.print(String.format("%d", n[0])) System.out.print System.out System System.out String.format("%d", n[0]) String.format String "%d" n[0] n 0 System.out.print(" ") System.out.print System.out System System.out " " System.out.print(String.format("%d", n[X-1])) System.out.print System.out System System.out String.format("%d", n[X-1]) String.format String "%d" n[X-1] n X-1 X 1 System.out.println(" " + sum) System.out.println System.out System System.out " " + sum " " sum String[] args args public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????

		Scanner scan = new Scanner(System.in);
		int X = scan.nextInt();
        int[] n = new int[X];
        long sum = 0;
        for(int i = 0; i < X; i++){
        	n[i] = scan.nextInt();
        	sum = sum + n[i];
        }

        // ?????????????????????????????????
        Arrays.sort(n);

        // ?????????????????????
        System.out.print(String.format("%d", n[0]));
        System.out.print(" ");
        System.out.print(String.format("%d", n[X-1]));
        System.out.println(" " + sum);
	}

} public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????

		Scanner scan = new Scanner(System.in);
		int X = scan.nextInt();
        int[] n = new int[X];
        long sum = 0;
        for(int i = 0; i < X; i++){
        	n[i] = scan.nextInt();
        	sum = sum + n[i];
        }

        // ?????????????????????????????????
        Arrays.sort(n);

        // ?????????????????????
        System.out.print(String.format("%d", n[0]));
        System.out.print(" ");
        System.out.print(String.format("%d", n[X-1]));
        System.out.println(" " + sum);
	}

} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????

		Scanner scan = new Scanner(System.in);
		int X = scan.nextInt();
        int[] n = new int[X];
        long sum = 0;
        for(int i = 0; i < X; i++){
        	n[i] = scan.nextInt();
        	sum = sum + n[i];
        }

        // ?????????????????????????????????
        Arrays.sort(n);

        // ?????????????????????
        System.out.print(String.format("%d", n[0]));
        System.out.print(" ");
        System.out.print(String.format("%d", n[X-1]));
        System.out.println(" " + sum);
	}

}