import java.util.Scanner;

class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int length = scanner.nextInt(), minimum = 0, maximum = 0;
		long total = 0;

		for (int i = 0; i < length; i++) {
			int number = scanner.nextInt();

			if (i == 0) {
				minimum = number;
				maximum = number;
			}

			total += number;

			if (number < minimum)
				minimum = number;
			if (number > maximum)
				maximum = number;
		}

		System.out.println(minimum + " " + maximum + " " + total);
	}
} import java.util.Scanner; Scanner java.util class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int length = scanner.nextInt(), minimum = 0, maximum = 0;
		long total = 0;

		for (int i = 0; i < length; i++) {
			int number = scanner.nextInt();

			if (i == 0) {
				minimum = number;
				maximum = number;
			}

			total += number;

			if (number < minimum)
				minimum = number;
			if (number > maximum)
				maximum = number;
		}

		System.out.println(minimum + " " + maximum + " " + total);
	}
} Main public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int length = scanner.nextInt(), minimum = 0, maximum = 0;
		long total = 0;

		for (int i = 0; i < length; i++) {
			int number = scanner.nextInt();

			if (i == 0) {
				minimum = number;
				maximum = number;
			}

			total += number;

			if (number < minimum)
				minimum = number;
			if (number > maximum)
				maximum = number;
		}

		System.out.println(minimum + " " + maximum + " " + total);
	} main {
		Scanner scanner = new Scanner(System.in);
		int length = scanner.nextInt(), minimum = 0, maximum = 0;
		long total = 0;

		for (int i = 0; i < length; i++) {
			int number = scanner.nextInt();

			if (i == 0) {
				minimum = number;
				maximum = number;
			}

			total += number;

			if (number < minimum)
				minimum = number;
			if (number > maximum)
				maximum = number;
		}

		System.out.println(minimum + " " + maximum + " " + total);
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int length = scanner.nextInt() length scanner.nextInt() scanner.nextInt scanner minimum = 0 minimum 0 maximum = 0; maximum 0 long total = 0; total 0 for (int i = 0; i < length; i++) {
			int number = scanner.nextInt();

			if (i == 0) {
				minimum = number;
				maximum = number;
			}

			total += number;

			if (number < minimum)
				minimum = number;
			if (number > maximum)
				maximum = number;
		} int i = 0; int i = 0; i 0 i < length i length i++ i++ i {
			int number = scanner.nextInt();

			if (i == 0) {
				minimum = number;
				maximum = number;
			}

			total += number;

			if (number < minimum)
				minimum = number;
			if (number > maximum)
				maximum = number;
		} {
			int number = scanner.nextInt();

			if (i == 0) {
				minimum = number;
				maximum = number;
			}

			total += number;

			if (number < minimum)
				minimum = number;
			if (number > maximum)
				maximum = number;
		} int number = scanner.nextInt(); number scanner.nextInt() scanner.nextInt scanner if (i == 0) {
				minimum = number;
				maximum = number;
			} i == 0 i 0 {
				minimum = number;
				maximum = number;
			} minimum = number minimum number maximum = number maximum number total += number total number if (number < minimum)
				minimum = number; number < minimum number minimum minimum = number minimum number if (number > maximum)
				maximum = number; number > maximum number maximum maximum = number maximum number System.out.println(minimum + " " + maximum + " " + total) System.out.println System.out System System.out minimum + " " + maximum + " " + total " " maximum minimum + " " + maximum + " " + total minimum " " maximum " " total String[] args args
import java.util.Scanner;

class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int length = scanner.nextInt(), minimum = 0, maximum = 0;
		long total = 0;

		for (int i = 0; i < length; i++) {
			int number = scanner.nextInt();

			if (i == 0) {
				minimum = number;
				maximum = number;
			}

			total += number;

			if (number < minimum)
				minimum = number;
			if (number > maximum)
				maximum = number;
		}

		System.out.println(minimum + " " + maximum + " " + total);
	}
}