import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int count = scanner.nextInt();
		
		long min = Integer.MAX_VALUE;
		long max = Integer.MIN_VALUE;
		long sum = 0;
		
		for (int i=0;i<count;i++){
			long t = scanner.nextInt();
			if (t < min) {
				min = t;
			}
			if (t > max) {
				max = t;
			}
			sum = sum + t;
		}
		
		System.out.println(""+ min + " " + max + " " + sum);
		
	}

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

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int count = scanner.nextInt();
		
		long min = Integer.MAX_VALUE;
		long max = Integer.MIN_VALUE;
		long sum = 0;
		
		for (int i=0;i<count;i++){
			long t = scanner.nextInt();
			if (t < min) {
				min = t;
			}
			if (t > max) {
				max = t;
			}
			sum = sum + t;
		}
		
		System.out.println(""+ min + " " + max + " " + sum);
		
	}

} Main public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int count = scanner.nextInt();
		
		long min = Integer.MAX_VALUE;
		long max = Integer.MIN_VALUE;
		long sum = 0;
		
		for (int i=0;i<count;i++){
			long t = scanner.nextInt();
			if (t < min) {
				min = t;
			}
			if (t > max) {
				max = t;
			}
			sum = sum + t;
		}
		
		System.out.println(""+ min + " " + max + " " + sum);
		
	} main {
		Scanner scanner = new Scanner(System.in);
		int count = scanner.nextInt();
		
		long min = Integer.MAX_VALUE;
		long max = Integer.MIN_VALUE;
		long sum = 0;
		
		for (int i=0;i<count;i++){
			long t = scanner.nextInt();
			if (t < min) {
				min = t;
			}
			if (t > max) {
				max = t;
			}
			sum = sum + t;
		}
		
		System.out.println(""+ min + " " + max + " " + sum);
		
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int count = scanner.nextInt(); count scanner.nextInt() scanner.nextInt scanner long min = Integer.MAX_VALUE; min Integer.MAX_VALUE Integer Integer.MAX_VALUE long max = Integer.MIN_VALUE; max Integer.MIN_VALUE Integer Integer.MIN_VALUE long sum = 0; sum 0 for (int i=0;i<count;i++){
			long t = scanner.nextInt();
			if (t < min) {
				min = t;
			}
			if (t > max) {
				max = t;
			}
			sum = sum + t;
		} int i=0; int i=0; i 0 i<count i count i++ i++ i {
			long t = scanner.nextInt();
			if (t < min) {
				min = t;
			}
			if (t > max) {
				max = t;
			}
			sum = sum + t;
		} {
			long t = scanner.nextInt();
			if (t < min) {
				min = t;
			}
			if (t > max) {
				max = t;
			}
			sum = sum + t;
		} long t = scanner.nextInt(); t scanner.nextInt() scanner.nextInt scanner if (t < min) {
				min = t;
			} t < min t min {
				min = t;
			} min = t min t if (t > max) {
				max = t;
			} t > max t max {
				max = t;
			} max = t max t sum = sum + t sum sum + t sum t 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 scanner = new Scanner(System.in);
		int count = scanner.nextInt();
		
		long min = Integer.MAX_VALUE;
		long max = Integer.MIN_VALUE;
		long sum = 0;
		
		for (int i=0;i<count;i++){
			long t = scanner.nextInt();
			if (t < min) {
				min = t;
			}
			if (t > max) {
				max = t;
			}
			sum = sum + t;
		}
		
		System.out.println(""+ min + " " + max + " " + sum);
		
	}

} public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int count = scanner.nextInt();
		
		long min = Integer.MAX_VALUE;
		long max = Integer.MIN_VALUE;
		long sum = 0;
		
		for (int i=0;i<count;i++){
			long t = scanner.nextInt();
			if (t < min) {
				min = t;
			}
			if (t > max) {
				max = t;
			}
			sum = sum + t;
		}
		
		System.out.println(""+ min + " " + max + " " + sum);
		
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int count = scanner.nextInt();
		
		long min = Integer.MAX_VALUE;
		long max = Integer.MIN_VALUE;
		long sum = 0;
		
		for (int i=0;i<count;i++){
			long t = scanner.nextInt();
			if (t < min) {
				min = t;
			}
			if (t > max) {
				max = t;
			}
			sum = sum + t;
		}
		
		System.out.println(""+ min + " " + max + " " + sum);
		
	}

}