import java.util.Scanner;

public class Main{
	public static void main(String [] args){
		Scanner sc = new Scanner(System.in);
		long n,min = 0,max = 0,sum = 0,work;
		n = sc.nextInt();
		min = max = sum = work = sc.nextInt();
		for(int i = 0; i < n - 1; i++){
			work = sc.nextInt();
			if(work > max){
				max = work;
			}
			if(work < min){
				min = work;
			}
			sum += work;
		}
		
		System.out.println(min + " " + max + " " + sum);
	}
} import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String [] args){
		Scanner sc = new Scanner(System.in);
		long n,min = 0,max = 0,sum = 0,work;
		n = sc.nextInt();
		min = max = sum = work = sc.nextInt();
		for(int i = 0; i < n - 1; i++){
			work = sc.nextInt();
			if(work > max){
				max = work;
			}
			if(work < min){
				min = work;
			}
			sum += work;
		}
		
		System.out.println(min + " " + max + " " + sum);
	}
} Main public static void main(String [] args){
		Scanner sc = new Scanner(System.in);
		long n,min = 0,max = 0,sum = 0,work;
		n = sc.nextInt();
		min = max = sum = work = sc.nextInt();
		for(int i = 0; i < n - 1; i++){
			work = sc.nextInt();
			if(work > max){
				max = work;
			}
			if(work < min){
				min = work;
			}
			sum += work;
		}
		
		System.out.println(min + " " + max + " " + sum);
	} main {
		Scanner sc = new Scanner(System.in);
		long n,min = 0,max = 0,sum = 0,work;
		n = sc.nextInt();
		min = max = sum = work = sc.nextInt();
		for(int i = 0; i < n - 1; i++){
			work = sc.nextInt();
			if(work > max){
				max = work;
			}
			if(work < min){
				min = work;
			}
			sum += work;
		}
		
		System.out.println(min + " " + max + " " + sum);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long n n min = 0 min 0 max = 0 max 0 sum = 0 sum 0 work; work n = sc.nextInt() n sc.nextInt() sc.nextInt sc min = max = sum = work = sc.nextInt() min max = sum = work = sc.nextInt() max sum = work = sc.nextInt() sum work = sc.nextInt() work sc.nextInt() sc.nextInt sc for(int i = 0; i < n - 1; i++){
			work = sc.nextInt();
			if(work > max){
				max = work;
			}
			if(work < min){
				min = work;
			}
			sum += work;
		} int i = 0; int i = 0; i 0 i < n - 1 i n - 1 n 1 i++ i++ i {
			work = sc.nextInt();
			if(work > max){
				max = work;
			}
			if(work < min){
				min = work;
			}
			sum += work;
		} {
			work = sc.nextInt();
			if(work > max){
				max = work;
			}
			if(work < min){
				min = work;
			}
			sum += work;
		} work = sc.nextInt() work sc.nextInt() sc.nextInt sc if(work > max){
				max = work;
			} work > max work max {
				max = work;
			} max = work max work if(work < min){
				min = work;
			} work < min work min {
				min = work;
			} min = work min work sum += work sum work 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 public class Main{
	public static void main(String [] args){
		Scanner sc = new Scanner(System.in);
		long n,min = 0,max = 0,sum = 0,work;
		n = sc.nextInt();
		min = max = sum = work = sc.nextInt();
		for(int i = 0; i < n - 1; i++){
			work = sc.nextInt();
			if(work > max){
				max = work;
			}
			if(work < min){
				min = work;
			}
			sum += work;
		}
		
		System.out.println(min + " " + max + " " + sum);
	}
} public class Main{
	public static void main(String [] args){
		Scanner sc = new Scanner(System.in);
		long n,min = 0,max = 0,sum = 0,work;
		n = sc.nextInt();
		min = max = sum = work = sc.nextInt();
		for(int i = 0; i < n - 1; i++){
			work = sc.nextInt();
			if(work > max){
				max = work;
			}
			if(work < min){
				min = work;
			}
			sum += work;
		}
		
		System.out.println(min + " " + max + " " + sum);
	}
} Main
import java.util.Scanner;

public class Main{
	public static void main(String [] args){
		Scanner sc = new Scanner(System.in);
		long n,min = 0,max = 0,sum = 0,work;
		n = sc.nextInt();
		min = max = sum = work = sc.nextInt();
		for(int i = 0; i < n - 1; i++){
			work = sc.nextInt();
			if(work > max){
				max = work;
			}
			if(work < min){
				min = work;
			}
			sum += work;
		}
		
		System.out.println(min + " " + max + " " + sum);
	}
}