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