import java.util.Scanner;

class Main {
	public static void main(String[] args) {
		
		Scanner scan = new Scanner(System.in);
		
		int n,num,min,max;
	
		long sum = 0;
		n =Integer.parseInt(scan.nextLine());
		String[] str = scan.nextLine().split(" ");
		num = 0;
		min = 1000000;
		max = -1000000;
		
		for(int i=0; i<n; i++){
			num = Integer.parseInt(str[i]);
			if(num>max){
				max = num;
			}
			if(num<min){
				min = num;
			}
			sum += num;
		}
		System.out.println(min + " " + max + " " + sum);
	}
}  import java.util.Scanner; Scanner java.util class Main {
	public static void main(String[] args) {
		
		Scanner scan = new Scanner(System.in);
		
		int n,num,min,max;
	
		long sum = 0;
		n =Integer.parseInt(scan.nextLine());
		String[] str = scan.nextLine().split(" ");
		num = 0;
		min = 1000000;
		max = -1000000;
		
		for(int i=0; i<n; i++){
			num = Integer.parseInt(str[i]);
			if(num>max){
				max = num;
			}
			if(num<min){
				min = num;
			}
			sum += num;
		}
		System.out.println(min + " " + max + " " + sum);
	}
} Main public static void main(String[] args) {
		
		Scanner scan = new Scanner(System.in);
		
		int n,num,min,max;
	
		long sum = 0;
		n =Integer.parseInt(scan.nextLine());
		String[] str = scan.nextLine().split(" ");
		num = 0;
		min = 1000000;
		max = -1000000;
		
		for(int i=0; i<n; i++){
			num = Integer.parseInt(str[i]);
			if(num>max){
				max = num;
			}
			if(num<min){
				min = num;
			}
			sum += num;
		}
		System.out.println(min + " " + max + " " + sum);
	} main {
		
		Scanner scan = new Scanner(System.in);
		
		int n,num,min,max;
	
		long sum = 0;
		n =Integer.parseInt(scan.nextLine());
		String[] str = scan.nextLine().split(" ");
		num = 0;
		min = 1000000;
		max = -1000000;
		
		for(int i=0; i<n; i++){
			num = Integer.parseInt(str[i]);
			if(num>max){
				max = num;
			}
			if(num<min){
				min = num;
			}
			sum += num;
		}
		System.out.println(min + " " + max + " " + sum);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n n num num min min max; max long sum = 0; sum 0 n =Integer.parseInt(scan.nextLine()) n Integer.parseInt(scan.nextLine()) Integer.parseInt Integer scan.nextLine() scan.nextLine scan String[] str = scan.nextLine().split(" "); str scan.nextLine().split(" ") scan.nextLine().split scan.nextLine() scan.nextLine scan " " num = 0 num 0 min = 1000000 min 1000000 max = -1000000 max -1000000 1000000 for(int i=0; i<n; i++){
			num = Integer.parseInt(str[i]);
			if(num>max){
				max = num;
			}
			if(num<min){
				min = num;
			}
			sum += num;
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			num = Integer.parseInt(str[i]);
			if(num>max){
				max = num;
			}
			if(num<min){
				min = num;
			}
			sum += num;
		} {
			num = Integer.parseInt(str[i]);
			if(num>max){
				max = num;
			}
			if(num<min){
				min = num;
			}
			sum += num;
		} num = Integer.parseInt(str[i]) num Integer.parseInt(str[i]) Integer.parseInt Integer str[i] str i if(num>max){
				max = num;
			} num>max num max {
				max = num;
			} max = num max num if(num<min){
				min = num;
			} num<min num min {
				min = num;
			} min = num min num sum += num sum num System.out.println(min + " " + max + " " + sum) System.out.println System.out System System.out min + " " + max + " " + sum " " max min + " " + max + " " + sum min " " max " " sum String[] args args
import java.util.Scanner;

class Main {
	public static void main(String[] args) {
		
		Scanner scan = new Scanner(System.in);
		
		int n,num,min,max;
	
		long sum = 0;
		n =Integer.parseInt(scan.nextLine());
		String[] str = scan.nextLine().split(" ");
		num = 0;
		min = 1000000;
		max = -1000000;
		
		for(int i=0; i<n; i++){
			num = Integer.parseInt(str[i]);
			if(num>max){
				max = num;
			}
			if(num<min){
				min = num;
			}
			sum += num;
		}
		System.out.println(min + " " + max + " " + sum);
	}
} 