import java.util.Scanner;
import java.io.IOException;

class Main {
	public static void main(String[] args) throws IOException {
		Scanner scan = new Scanner(System.in);
		int n = Integer.parseInt(scan.nextLine());
		int big = Integer.MIN_VALUE;
		int small = Integer.MAX_VALUE;
		long total = 0;
		for (int i = 0; i < n; i++) {
			int a = scan.nextInt();
			if (big < a) {
				big = a;
			}
			if (a < small) {
				small = a;
			}
			total = total + a;
		}
		System.out.println(small + " " + big + " " + total);
	}
} import java.util.Scanner; Scanner java.util import java.io.IOException; IOException java.io class Main {
	public static void main(String[] args) throws IOException {
		Scanner scan = new Scanner(System.in);
		int n = Integer.parseInt(scan.nextLine());
		int big = Integer.MIN_VALUE;
		int small = Integer.MAX_VALUE;
		long total = 0;
		for (int i = 0; i < n; i++) {
			int a = scan.nextInt();
			if (big < a) {
				big = a;
			}
			if (a < small) {
				small = a;
			}
			total = total + a;
		}
		System.out.println(small + " " + big + " " + total);
	}
} Main public static void main(String[] args) throws IOException {
		Scanner scan = new Scanner(System.in);
		int n = Integer.parseInt(scan.nextLine());
		int big = Integer.MIN_VALUE;
		int small = Integer.MAX_VALUE;
		long total = 0;
		for (int i = 0; i < n; i++) {
			int a = scan.nextInt();
			if (big < a) {
				big = a;
			}
			if (a < small) {
				small = a;
			}
			total = total + a;
		}
		System.out.println(small + " " + big + " " + total);
	} main {
		Scanner scan = new Scanner(System.in);
		int n = Integer.parseInt(scan.nextLine());
		int big = Integer.MIN_VALUE;
		int small = Integer.MAX_VALUE;
		long total = 0;
		for (int i = 0; i < n; i++) {
			int a = scan.nextInt();
			if (big < a) {
				big = a;
			}
			if (a < small) {
				small = a;
			}
			total = total + a;
		}
		System.out.println(small + " " + big + " " + total);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = Integer.parseInt(scan.nextLine()); n Integer.parseInt(scan.nextLine()) Integer.parseInt Integer scan.nextLine() scan.nextLine scan int big = Integer.MIN_VALUE; big Integer.MIN_VALUE Integer Integer.MIN_VALUE int small = Integer.MAX_VALUE; small Integer.MAX_VALUE Integer Integer.MAX_VALUE long total = 0; total 0 for (int i = 0; i < n; i++) {
			int a = scan.nextInt();
			if (big < a) {
				big = a;
			}
			if (a < small) {
				small = a;
			}
			total = total + a;
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			int a = scan.nextInt();
			if (big < a) {
				big = a;
			}
			if (a < small) {
				small = a;
			}
			total = total + a;
		} {
			int a = scan.nextInt();
			if (big < a) {
				big = a;
			}
			if (a < small) {
				small = a;
			}
			total = total + a;
		} int a = scan.nextInt(); a scan.nextInt() scan.nextInt scan if (big < a) {
				big = a;
			} big < a big a {
				big = a;
			} big = a big a if (a < small) {
				small = a;
			} a < small a small {
				small = a;
			} small = a small a total = total + a total total + a total a System.out.println(small + " " + big + " " + total) System.out.println System.out System System.out small + " " + big + " " + total " " big small + " " + big + " " + total small " " big " " total String[] args args
import java.util.Scanner;
import java.io.IOException;

class Main {
	public static void main(String[] args) throws IOException {
		Scanner scan = new Scanner(System.in);
		int n = Integer.parseInt(scan.nextLine());
		int big = Integer.MIN_VALUE;
		int small = Integer.MAX_VALUE;
		long total = 0;
		for (int i = 0; i < n; i++) {
			int a = scan.nextInt();
			if (big < a) {
				big = a;
			}
			if (a < small) {
				small = a;
			}
			total = total + a;
		}
		System.out.println(small + " " + big + " " + total);
	}
}