import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		
		int a = s.nextInt();
		int min = a;
		int max = a;
		long sum = a;
		
		for(int i=2; i<=n; i++){
			a = s.nextInt();
			if(a < min){
				min = a;
			}
			if(a > max){
				max = a;
			}
			sum += a;
		}
		
		System.out.println(min + " " + max + " " + sum);
		
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		
		int a = s.nextInt();
		int min = a;
		int max = a;
		long sum = a;
		
		for(int i=2; i<=n; i++){
			a = s.nextInt();
			if(a < min){
				min = a;
			}
			if(a > max){
				max = a;
			}
			sum += a;
		}
		
		System.out.println(min + " " + max + " " + sum);
		
	}

} Main public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		
		int a = s.nextInt();
		int min = a;
		int max = a;
		long sum = a;
		
		for(int i=2; i<=n; i++){
			a = s.nextInt();
			if(a < min){
				min = a;
			}
			if(a > max){
				max = a;
			}
			sum += a;
		}
		
		System.out.println(min + " " + max + " " + sum);
		
	} main {
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		
		int a = s.nextInt();
		int min = a;
		int max = a;
		long sum = a;
		
		for(int i=2; i<=n; i++){
			a = s.nextInt();
			if(a < min){
				min = a;
			}
			if(a > max){
				max = a;
			}
			sum += a;
		}
		
		System.out.println(min + " " + max + " " + sum);
		
	} Scanner s = new Scanner(System.in); s new Scanner(System.in) int n = s.nextInt(); n s.nextInt() s.nextInt s int a = s.nextInt(); a s.nextInt() s.nextInt s int min = a; min a int max = a; max a long sum = a; sum a for(int i=2; i<=n; i++){
			a = s.nextInt();
			if(a < min){
				min = a;
			}
			if(a > max){
				max = a;
			}
			sum += a;
		} int i=2; int i=2; i 2 i<=n i n i++ i++ i {
			a = s.nextInt();
			if(a < min){
				min = a;
			}
			if(a > max){
				max = a;
			}
			sum += a;
		} {
			a = s.nextInt();
			if(a < min){
				min = a;
			}
			if(a > max){
				max = a;
			}
			sum += a;
		} a = s.nextInt() a s.nextInt() s.nextInt s if(a < min){
				min = a;
			} a < min a min {
				min = a;
			} min = a min a if(a > max){
				max = a;
			} a > max a max {
				max = a;
			} max = a max a sum += a sum a 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 s = new Scanner(System.in);
		int n = s.nextInt();
		
		int a = s.nextInt();
		int min = a;
		int max = a;
		long sum = a;
		
		for(int i=2; i<=n; i++){
			a = s.nextInt();
			if(a < min){
				min = a;
			}
			if(a > max){
				max = a;
			}
			sum += a;
		}
		
		System.out.println(min + " " + max + " " + sum);
		
	}

} public class Main {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		
		int a = s.nextInt();
		int min = a;
		int max = a;
		long sum = a;
		
		for(int i=2; i<=n; i++){
			a = s.nextInt();
			if(a < min){
				min = a;
			}
			if(a > max){
				max = a;
			}
			sum += a;
		}
		
		System.out.println(min + " " + max + " " + sum);
		
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		
		int a = s.nextInt();
		int min = a;
		int max = a;
		long sum = a;
		
		for(int i=2; i<=n; i++){
			a = s.nextInt();
			if(a < min){
				min = a;
			}
			if(a > max){
				max = a;
			}
			sum += a;
		}
		
		System.out.println(min + " " + max + " " + sum);
		
	}

}