import java.util.Scanner;
class Main {
	public void kami() {
		Scanner sc = new Scanner(System.in);
		long gou = 0;
		int min = 1000000;
		int max = -1000000;
		int n = sc.nextInt();
		if(n == 0){
			min = 0;
			max = 0;
		}else {
			for(int i = 1; i <= n; i++){
				int ai = sc.nextInt();
				gou = ai + gou;
				
				if(n == 1){
					min = ai;
					max = ai;
				}
				
				if(ai < min){
					min = ai;
				}else if(ai > max){
					max = ai;
				}
			}
		}
		
		System.out.println(min + " " + max + " " + gou);
	}

    public static void main(String[] args) {
		new Main().kami();
	}

} import java.util.Scanner; Scanner java.util class Main {
	public void kami() {
		Scanner sc = new Scanner(System.in);
		long gou = 0;
		int min = 1000000;
		int max = -1000000;
		int n = sc.nextInt();
		if(n == 0){
			min = 0;
			max = 0;
		}else {
			for(int i = 1; i <= n; i++){
				int ai = sc.nextInt();
				gou = ai + gou;
				
				if(n == 1){
					min = ai;
					max = ai;
				}
				
				if(ai < min){
					min = ai;
				}else if(ai > max){
					max = ai;
				}
			}
		}
		
		System.out.println(min + " " + max + " " + gou);
	}

    public static void main(String[] args) {
		new Main().kami();
	}

} Main public void kami() {
		Scanner sc = new Scanner(System.in);
		long gou = 0;
		int min = 1000000;
		int max = -1000000;
		int n = sc.nextInt();
		if(n == 0){
			min = 0;
			max = 0;
		}else {
			for(int i = 1; i <= n; i++){
				int ai = sc.nextInt();
				gou = ai + gou;
				
				if(n == 1){
					min = ai;
					max = ai;
				}
				
				if(ai < min){
					min = ai;
				}else if(ai > max){
					max = ai;
				}
			}
		}
		
		System.out.println(min + " " + max + " " + gou);
	} kami {
		Scanner sc = new Scanner(System.in);
		long gou = 0;
		int min = 1000000;
		int max = -1000000;
		int n = sc.nextInt();
		if(n == 0){
			min = 0;
			max = 0;
		}else {
			for(int i = 1; i <= n; i++){
				int ai = sc.nextInt();
				gou = ai + gou;
				
				if(n == 1){
					min = ai;
					max = ai;
				}
				
				if(ai < min){
					min = ai;
				}else if(ai > max){
					max = ai;
				}
			}
		}
		
		System.out.println(min + " " + max + " " + gou);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long gou = 0; gou 0 int min = 1000000; min 1000000 int max = -1000000; max -1000000 1000000 int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc if(n == 0){
			min = 0;
			max = 0;
		}else {
			for(int i = 1; i <= n; i++){
				int ai = sc.nextInt();
				gou = ai + gou;
				
				if(n == 1){
					min = ai;
					max = ai;
				}
				
				if(ai < min){
					min = ai;
				}else if(ai > max){
					max = ai;
				}
			}
		} n == 0 n 0 {
			min = 0;
			max = 0;
		} min = 0 min 0 max = 0 max 0 {
			for(int i = 1; i <= n; i++){
				int ai = sc.nextInt();
				gou = ai + gou;
				
				if(n == 1){
					min = ai;
					max = ai;
				}
				
				if(ai < min){
					min = ai;
				}else if(ai > max){
					max = ai;
				}
			}
		} for(int i = 1; i <= n; i++){
				int ai = sc.nextInt();
				gou = ai + gou;
				
				if(n == 1){
					min = ai;
					max = ai;
				}
				
				if(ai < min){
					min = ai;
				}else if(ai > max){
					max = ai;
				}
			} int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
				int ai = sc.nextInt();
				gou = ai + gou;
				
				if(n == 1){
					min = ai;
					max = ai;
				}
				
				if(ai < min){
					min = ai;
				}else if(ai > max){
					max = ai;
				}
			} {
				int ai = sc.nextInt();
				gou = ai + gou;
				
				if(n == 1){
					min = ai;
					max = ai;
				}
				
				if(ai < min){
					min = ai;
				}else if(ai > max){
					max = ai;
				}
			} int ai = sc.nextInt(); ai sc.nextInt() sc.nextInt sc gou = ai + gou gou ai + gou ai gou if(n == 1){
					min = ai;
					max = ai;
				} n == 1 n 1 {
					min = ai;
					max = ai;
				} min = ai min ai max = ai max ai if(ai < min){
					min = ai;
				}else if(ai > max){
					max = ai;
				} ai < min ai min {
					min = ai;
				} min = ai min ai if(ai > max){
					max = ai;
				} ai > max ai max {
					max = ai;
				} max = ai max ai System.out.println(min + " " + max + " " + gou) System.out.println System.out System System.out min + " " + max + " " + gou " " max min + " " + max + " " + gou min " " max " " gou public static void main(String[] args) {
		new Main().kami();
	} main {
		new Main().kami();
	} new Main().kami() new Main().kami new Main() String[] args args
import java.util.Scanner;
class Main {
	public void kami() {
		Scanner sc = new Scanner(System.in);
		long gou = 0;
		int min = 1000000;
		int max = -1000000;
		int n = sc.nextInt();
		if(n == 0){
			min = 0;
			max = 0;
		}else {
			for(int i = 1; i <= n; i++){
				int ai = sc.nextInt();
				gou = ai + gou;
				
				if(n == 1){
					min = ai;
					max = ai;
				}
				
				if(ai < min){
					min = ai;
				}else if(ai > max){
					max = ai;
				}
			}
		}
		
		System.out.println(min + " " + max + " " + gou);
	}

    public static void main(String[] args) {
		new Main().kami();
	}

}