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 y = 2147483647;
		int z = -2147483648;
		long sum = 0;
		for(int i = 0; i < X; i++){
			int a = scan.nextInt();
			
			y = Math.min(y, a);
			z = Math.max(z, a);
			sum = sum + a;
		}
			System.out.println(y + " " + z + " " + 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 y = 2147483647;
		int z = -2147483648;
		long sum = 0;
		for(int i = 0; i < X; i++){
			int a = scan.nextInt();
			
			y = Math.min(y, a);
			z = Math.max(z, a);
			sum = sum + a;
		}
			System.out.println(y + " " + z + " " + sum);
	}

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

		Scanner scan = new Scanner(System.in);
		int X = scan.nextInt();
		int y = 2147483647;
		int z = -2147483648;
		long sum = 0;
		for(int i = 0; i < X; i++){
			int a = scan.nextInt();
			
			y = Math.min(y, a);
			z = Math.max(z, a);
			sum = sum + a;
		}
			System.out.println(y + " " + z + " " + sum);
	} main {
		// TODO ?????????????????????????????????????????????

		Scanner scan = new Scanner(System.in);
		int X = scan.nextInt();
		int y = 2147483647;
		int z = -2147483648;
		long sum = 0;
		for(int i = 0; i < X; i++){
			int a = scan.nextInt();
			
			y = Math.min(y, a);
			z = Math.max(z, a);
			sum = sum + a;
		}
			System.out.println(y + " " + z + " " + sum);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int X = scan.nextInt(); X scan.nextInt() scan.nextInt scan int y = 2147483647; y 2147483647 int z = -2147483648; z -2147483648 2147483648 long sum = 0; sum 0 for(int i = 0; i < X; i++){
			int a = scan.nextInt();
			
			y = Math.min(y, a);
			z = Math.max(z, a);
			sum = sum + a;
		} int i = 0; int i = 0; i 0 i < X i X i++ i++ i {
			int a = scan.nextInt();
			
			y = Math.min(y, a);
			z = Math.max(z, a);
			sum = sum + a;
		} {
			int a = scan.nextInt();
			
			y = Math.min(y, a);
			z = Math.max(z, a);
			sum = sum + a;
		} int a = scan.nextInt(); a scan.nextInt() scan.nextInt scan y = Math.min(y, a) y Math.min(y, a) Math.min Math y a z = Math.max(z, a) z Math.max(z, a) Math.max Math z a sum = sum + a sum sum + a sum a System.out.println(y + " " + z + " " + sum) System.out.println System.out System System.out y + " " + z + " " + sum " " z y + " " + z + " " + sum y " " z " " 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 y = 2147483647;
		int z = -2147483648;
		long sum = 0;
		for(int i = 0; i < X; i++){
			int a = scan.nextInt();
			
			y = Math.min(y, a);
			z = Math.max(z, a);
			sum = sum + a;
		}
			System.out.println(y + " " + z + " " + sum);
	}

} public class Main {

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

		Scanner scan = new Scanner(System.in);
		int X = scan.nextInt();
		int y = 2147483647;
		int z = -2147483648;
		long sum = 0;
		for(int i = 0; i < X; i++){
			int a = scan.nextInt();
			
			y = Math.min(y, a);
			z = Math.max(z, a);
			sum = sum + a;
		}
			System.out.println(y + " " + z + " " + 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 y = 2147483647;
		int z = -2147483648;
		long sum = 0;
		for(int i = 0; i < X; i++){
			int a = scan.nextInt();
			
			y = Math.min(y, a);
			z = Math.max(z, a);
			sum = sum + a;
		}
			System.out.println(y + " " + z + " " + sum);
	}

}