import java.util.Scanner;


public class Main {
	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		int min =1000000;
		int max = -1000000;
		long sum = 0;
		
		int line = sc.nextInt();
		int L[] = new int[line];
		
		for(int i = 0; i < line; i++){
			int value = sc.nextInt();
			
			if(min > value){
				min = value;
			}
			if(max < value){
				max = value;
			}
			sum += value;
		}
		System.out.println(String.format("%d %d %d", min, max, sum));
		sc.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		int min =1000000;
		int max = -1000000;
		long sum = 0;
		
		int line = sc.nextInt();
		int L[] = new int[line];
		
		for(int i = 0; i < line; i++){
			int value = sc.nextInt();
			
			if(min > value){
				min = value;
			}
			if(max < value){
				max = value;
			}
			sum += value;
		}
		System.out.println(String.format("%d %d %d", min, max, sum));
		sc.close();
	}
} Main public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		int min =1000000;
		int max = -1000000;
		long sum = 0;
		
		int line = sc.nextInt();
		int L[] = new int[line];
		
		for(int i = 0; i < line; i++){
			int value = sc.nextInt();
			
			if(min > value){
				min = value;
			}
			if(max < value){
				max = value;
			}
			sum += value;
		}
		System.out.println(String.format("%d %d %d", min, max, sum));
		sc.close();
	} main {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		int min =1000000;
		int max = -1000000;
		long sum = 0;
		
		int line = sc.nextInt();
		int L[] = new int[line];
		
		for(int i = 0; i < line; i++){
			int value = sc.nextInt();
			
			if(min > value){
				min = value;
			}
			if(max < value){
				max = value;
			}
			sum += value;
		}
		System.out.println(String.format("%d %d %d", min, max, sum));
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int min =1000000; min 1000000 int max = -1000000; max -1000000 1000000 long sum = 0; sum 0 int line = sc.nextInt(); line sc.nextInt() sc.nextInt sc int L[] = new int[line]; L new int[line] line for(int i = 0; i < line; i++){
			int value = sc.nextInt();
			
			if(min > value){
				min = value;
			}
			if(max < value){
				max = value;
			}
			sum += value;
		} int i = 0; int i = 0; i 0 i < line i line i++ i++ i {
			int value = sc.nextInt();
			
			if(min > value){
				min = value;
			}
			if(max < value){
				max = value;
			}
			sum += value;
		} {
			int value = sc.nextInt();
			
			if(min > value){
				min = value;
			}
			if(max < value){
				max = value;
			}
			sum += value;
		} int value = sc.nextInt(); value sc.nextInt() sc.nextInt sc if(min > value){
				min = value;
			} min > value min value {
				min = value;
			} min = value min value if(max < value){
				max = value;
			} max < value max value {
				max = value;
			} max = value max value sum += value sum value System.out.println(String.format("%d %d %d", min, max, sum)) System.out.println System.out System System.out String.format("%d %d %d", min, max, sum) String.format String "%d %d %d" min max sum sc.close() sc.close sc String[] args args public class Main {
	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		int min =1000000;
		int max = -1000000;
		long sum = 0;
		
		int line = sc.nextInt();
		int L[] = new int[line];
		
		for(int i = 0; i < line; i++){
			int value = sc.nextInt();
			
			if(min > value){
				min = value;
			}
			if(max < value){
				max = value;
			}
			sum += value;
		}
		System.out.println(String.format("%d %d %d", min, max, sum));
		sc.close();
	}
} public class Main {
	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		int min =1000000;
		int max = -1000000;
		long sum = 0;
		
		int line = sc.nextInt();
		int L[] = new int[line];
		
		for(int i = 0; i < line; i++){
			int value = sc.nextInt();
			
			if(min > value){
				min = value;
			}
			if(max < value){
				max = value;
			}
			sum += value;
		}
		System.out.println(String.format("%d %d %d", min, max, sum));
		sc.close();
	}
} Main
import java.util.Scanner;


public class Main {
	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		int min =1000000;
		int max = -1000000;
		long sum = 0;
		
		int line = sc.nextInt();
		int L[] = new int[line];
		
		for(int i = 0; i < line; i++){
			int value = sc.nextInt();
			
			if(min > value){
				min = value;
			}
			if(max < value){
				max = value;
			}
			sum += value;
		}
		System.out.println(String.format("%d %d %d", min, max, sum));
		sc.close();
	}
}