import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static Scanner scanner = new Scanner(System.in);

	public static void main(String[] args) {

		int[] arrays = new int[Integer.parseInt(input())];
		long sumArrays = 0;

		for (int i = 0; i < arrays.length; i++) {

			arrays[i] = Integer.parseInt(input());
			sumArrays += (long) arrays[i];

		}

		Arrays.sort(arrays);

		System.out.print(arrays[0]);
		System.out.print(" ");
		System.out.print(arrays[arrays.length - 1]);
		System.out.print(" ");
		System.out.println(sumArrays);

		close();

	}

	public static String input() {

		return scanner.next();

	}

	public static void close() {

		if (scanner != null) {

			scanner.close();

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

	public static Scanner scanner = new Scanner(System.in);

	public static void main(String[] args) {

		int[] arrays = new int[Integer.parseInt(input())];
		long sumArrays = 0;

		for (int i = 0; i < arrays.length; i++) {

			arrays[i] = Integer.parseInt(input());
			sumArrays += (long) arrays[i];

		}

		Arrays.sort(arrays);

		System.out.print(arrays[0]);
		System.out.print(" ");
		System.out.print(arrays[arrays.length - 1]);
		System.out.print(" ");
		System.out.println(sumArrays);

		close();

	}

	public static String input() {

		return scanner.next();

	}

	public static void close() {

		if (scanner != null) {

			scanner.close();

		}
	}
} Main public static Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) public static void main(String[] args) {

		int[] arrays = new int[Integer.parseInt(input())];
		long sumArrays = 0;

		for (int i = 0; i < arrays.length; i++) {

			arrays[i] = Integer.parseInt(input());
			sumArrays += (long) arrays[i];

		}

		Arrays.sort(arrays);

		System.out.print(arrays[0]);
		System.out.print(" ");
		System.out.print(arrays[arrays.length - 1]);
		System.out.print(" ");
		System.out.println(sumArrays);

		close();

	} main {

		int[] arrays = new int[Integer.parseInt(input())];
		long sumArrays = 0;

		for (int i = 0; i < arrays.length; i++) {

			arrays[i] = Integer.parseInt(input());
			sumArrays += (long) arrays[i];

		}

		Arrays.sort(arrays);

		System.out.print(arrays[0]);
		System.out.print(" ");
		System.out.print(arrays[arrays.length - 1]);
		System.out.print(" ");
		System.out.println(sumArrays);

		close();

	} int[] arrays = new int[Integer.parseInt(input())]; arrays new int[Integer.parseInt(input())] Integer.parseInt(input()) Integer.parseInt Integer input() input long sumArrays = 0; sumArrays 0 for (int i = 0; i < arrays.length; i++) {

			arrays[i] = Integer.parseInt(input());
			sumArrays += (long) arrays[i];

		} int i = 0; int i = 0; i 0 i < arrays.length i arrays.length arrays arrays.length i++ i++ i {

			arrays[i] = Integer.parseInt(input());
			sumArrays += (long) arrays[i];

		} {

			arrays[i] = Integer.parseInt(input());
			sumArrays += (long) arrays[i];

		} arrays[i] = Integer.parseInt(input()) arrays[i] arrays i Integer.parseInt(input()) Integer.parseInt Integer input() input sumArrays += (long) arrays[i] sumArrays (long) arrays[i] arrays i Arrays.sort(arrays) Arrays.sort Arrays arrays System.out.print(arrays[0]) System.out.print System.out System System.out arrays[0] arrays 0 System.out.print(" ") System.out.print System.out System System.out " " System.out.print(arrays[arrays.length - 1]) System.out.print System.out System System.out arrays[arrays.length - 1] arrays arrays.length - 1 arrays.length arrays arrays.length 1 System.out.print(" ") System.out.print System.out System System.out " " System.out.println(sumArrays) System.out.println System.out System System.out sumArrays close() close String[] args args public static String input() {

		return scanner.next();

	} input {

		return scanner.next();

	} return scanner.next(); scanner.next() scanner.next scanner public static void close() {

		if (scanner != null) {

			scanner.close();

		}
	} close {

		if (scanner != null) {

			scanner.close();

		}
	} if (scanner != null) {

			scanner.close();

		} scanner != null scanner null {

			scanner.close();

		} scanner.close() scanner.close scanner public class Main {

	public static Scanner scanner = new Scanner(System.in);

	public static void main(String[] args) {

		int[] arrays = new int[Integer.parseInt(input())];
		long sumArrays = 0;

		for (int i = 0; i < arrays.length; i++) {

			arrays[i] = Integer.parseInt(input());
			sumArrays += (long) arrays[i];

		}

		Arrays.sort(arrays);

		System.out.print(arrays[0]);
		System.out.print(" ");
		System.out.print(arrays[arrays.length - 1]);
		System.out.print(" ");
		System.out.println(sumArrays);

		close();

	}

	public static String input() {

		return scanner.next();

	}

	public static void close() {

		if (scanner != null) {

			scanner.close();

		}
	}
} public class Main {

	public static Scanner scanner = new Scanner(System.in);

	public static void main(String[] args) {

		int[] arrays = new int[Integer.parseInt(input())];
		long sumArrays = 0;

		for (int i = 0; i < arrays.length; i++) {

			arrays[i] = Integer.parseInt(input());
			sumArrays += (long) arrays[i];

		}

		Arrays.sort(arrays);

		System.out.print(arrays[0]);
		System.out.print(" ");
		System.out.print(arrays[arrays.length - 1]);
		System.out.print(" ");
		System.out.println(sumArrays);

		close();

	}

	public static String input() {

		return scanner.next();

	}

	public static void close() {

		if (scanner != null) {

			scanner.close();

		}
	}
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static Scanner scanner = new Scanner(System.in);

	public static void main(String[] args) {

		int[] arrays = new int[Integer.parseInt(input())];
		long sumArrays = 0;

		for (int i = 0; i < arrays.length; i++) {

			arrays[i] = Integer.parseInt(input());
			sumArrays += (long) arrays[i];

		}

		Arrays.sort(arrays);

		System.out.print(arrays[0]);
		System.out.print(" ");
		System.out.print(arrays[arrays.length - 1]);
		System.out.print(" ");
		System.out.println(sumArrays);

		close();

	}

	public static String input() {

		return scanner.next();

	}

	public static void close() {

		if (scanner != null) {

			scanner.close();

		}
	}
}