import java.util.*;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
	    
		int n = sc.nextInt();
		int max = -1000000;
		int min = 1000000;
		long total = 0;
		
		for (int i = 0; i < n; i++){
			int temp = sc.nextInt();
			if (temp > max){ max = temp;}
			if (temp < min){ min = temp;}
			total += temp;
		}
		System.out.printf("%d %d %d\n", min, max, total);
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
	    
		int n = sc.nextInt();
		int max = -1000000;
		int min = 1000000;
		long total = 0;
		
		for (int i = 0; i < n; i++){
			int temp = sc.nextInt();
			if (temp > max){ max = temp;}
			if (temp < min){ min = temp;}
			total += temp;
		}
		System.out.printf("%d %d %d\n", min, max, total);
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
	    
		int n = sc.nextInt();
		int max = -1000000;
		int min = 1000000;
		long total = 0;
		
		for (int i = 0; i < n; i++){
			int temp = sc.nextInt();
			if (temp > max){ max = temp;}
			if (temp < min){ min = temp;}
			total += temp;
		}
		System.out.printf("%d %d %d\n", min, max, total);
	} main {
		Scanner sc = new Scanner(System.in);
	    
		int n = sc.nextInt();
		int max = -1000000;
		int min = 1000000;
		long total = 0;
		
		for (int i = 0; i < n; i++){
			int temp = sc.nextInt();
			if (temp > max){ max = temp;}
			if (temp < min){ min = temp;}
			total += temp;
		}
		System.out.printf("%d %d %d\n", min, max, total);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int max = -1000000; max -1000000 1000000 int min = 1000000; min 1000000 long total = 0; total 0 for (int i = 0; i < n; i++){
			int temp = sc.nextInt();
			if (temp > max){ max = temp;}
			if (temp < min){ min = temp;}
			total += temp;
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			int temp = sc.nextInt();
			if (temp > max){ max = temp;}
			if (temp < min){ min = temp;}
			total += temp;
		} {
			int temp = sc.nextInt();
			if (temp > max){ max = temp;}
			if (temp < min){ min = temp;}
			total += temp;
		} int temp = sc.nextInt(); temp sc.nextInt() sc.nextInt sc if (temp > max){ max = temp;} temp > max temp max { max = temp;} max = temp max temp if (temp < min){ min = temp;} temp < min temp min { min = temp;} min = temp min temp total += temp total temp System.out.printf("%d %d %d\n", min, max, total) System.out.printf System.out System System.out "%d %d %d\n" min max total String[] args args public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
	    
		int n = sc.nextInt();
		int max = -1000000;
		int min = 1000000;
		long total = 0;
		
		for (int i = 0; i < n; i++){
			int temp = sc.nextInt();
			if (temp > max){ max = temp;}
			if (temp < min){ min = temp;}
			total += temp;
		}
		System.out.printf("%d %d %d\n", min, max, total);
	}
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
	    
		int n = sc.nextInt();
		int max = -1000000;
		int min = 1000000;
		long total = 0;
		
		for (int i = 0; i < n; i++){
			int temp = sc.nextInt();
			if (temp > max){ max = temp;}
			if (temp < min){ min = temp;}
			total += temp;
		}
		System.out.printf("%d %d %d\n", min, max, total);
	}
} Main
import java.util.*;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
	    
		int n = sc.nextInt();
		int max = -1000000;
		int min = 1000000;
		long total = 0;
		
		for (int i = 0; i < n; i++){
			int temp = sc.nextInt();
			if (temp > max){ max = temp;}
			if (temp < min){ min = temp;}
			total += temp;
		}
		System.out.printf("%d %d %d\n", min, max, total);
	}
}