import java.util.ArrayList;
import java.util.Scanner;

public class Main {
	void run() {
		Scanner scan = new Scanner(System.in);
		ArrayList<Integer> list = new ArrayList<Integer>();
		int n = scan.nextInt();
		int min = 0;
		int max = 0;
		long sum = 0;
		for (int i = 0; i < n; i++) {
			list.add(scan.nextInt());
			int num = list.get(i);
			if (i == 0) {
				min = num;
				max = num;
			}
			sum += num;
			min = Math.min(min, num);
			max = Math.max(max, num);
		}
		System.out.printf("%d %d %d\n", min, max, sum);
	}
	public static void main(String[] args) {
		Main m = new Main();
		m.run();
	}
} import java.util.ArrayList; ArrayList java.util import java.util.Scanner; Scanner java.util public class Main {
	void run() {
		Scanner scan = new Scanner(System.in);
		ArrayList<Integer> list = new ArrayList<Integer>();
		int n = scan.nextInt();
		int min = 0;
		int max = 0;
		long sum = 0;
		for (int i = 0; i < n; i++) {
			list.add(scan.nextInt());
			int num = list.get(i);
			if (i == 0) {
				min = num;
				max = num;
			}
			sum += num;
			min = Math.min(min, num);
			max = Math.max(max, num);
		}
		System.out.printf("%d %d %d\n", min, max, sum);
	}
	public static void main(String[] args) {
		Main m = new Main();
		m.run();
	}
} Main void run() {
		Scanner scan = new Scanner(System.in);
		ArrayList<Integer> list = new ArrayList<Integer>();
		int n = scan.nextInt();
		int min = 0;
		int max = 0;
		long sum = 0;
		for (int i = 0; i < n; i++) {
			list.add(scan.nextInt());
			int num = list.get(i);
			if (i == 0) {
				min = num;
				max = num;
			}
			sum += num;
			min = Math.min(min, num);
			max = Math.max(max, num);
		}
		System.out.printf("%d %d %d\n", min, max, sum);
	} run {
		Scanner scan = new Scanner(System.in);
		ArrayList<Integer> list = new ArrayList<Integer>();
		int n = scan.nextInt();
		int min = 0;
		int max = 0;
		long sum = 0;
		for (int i = 0; i < n; i++) {
			list.add(scan.nextInt());
			int num = list.get(i);
			if (i == 0) {
				min = num;
				max = num;
			}
			sum += num;
			min = Math.min(min, num);
			max = Math.max(max, num);
		}
		System.out.printf("%d %d %d\n", min, max, sum);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) ArrayList<Integer> list = new ArrayList<Integer>(); list new ArrayList<Integer>() int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int min = 0; min 0 int max = 0; max 0 long sum = 0; sum 0 for (int i = 0; i < n; i++) {
			list.add(scan.nextInt());
			int num = list.get(i);
			if (i == 0) {
				min = num;
				max = num;
			}
			sum += num;
			min = Math.min(min, num);
			max = Math.max(max, num);
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			list.add(scan.nextInt());
			int num = list.get(i);
			if (i == 0) {
				min = num;
				max = num;
			}
			sum += num;
			min = Math.min(min, num);
			max = Math.max(max, num);
		} {
			list.add(scan.nextInt());
			int num = list.get(i);
			if (i == 0) {
				min = num;
				max = num;
			}
			sum += num;
			min = Math.min(min, num);
			max = Math.max(max, num);
		} list.add(scan.nextInt()) list.add list scan.nextInt() scan.nextInt scan int num = list.get(i); num list.get(i) list.get list i if (i == 0) {
				min = num;
				max = num;
			} i == 0 i 0 {
				min = num;
				max = num;
			} min = num min num max = num max num sum += num sum num min = Math.min(min, num) min Math.min(min, num) Math.min Math min num max = Math.max(max, num) max Math.max(max, num) Math.max Math max num System.out.printf("%d %d %d\n", min, max, sum) System.out.printf System.out System System.out "%d %d %d\n" min max sum public static void main(String[] args) {
		Main m = new Main();
		m.run();
	} main {
		Main m = new Main();
		m.run();
	} Main m = new Main(); m new Main() m.run() m.run m String[] args args public class Main {
	void run() {
		Scanner scan = new Scanner(System.in);
		ArrayList<Integer> list = new ArrayList<Integer>();
		int n = scan.nextInt();
		int min = 0;
		int max = 0;
		long sum = 0;
		for (int i = 0; i < n; i++) {
			list.add(scan.nextInt());
			int num = list.get(i);
			if (i == 0) {
				min = num;
				max = num;
			}
			sum += num;
			min = Math.min(min, num);
			max = Math.max(max, num);
		}
		System.out.printf("%d %d %d\n", min, max, sum);
	}
	public static void main(String[] args) {
		Main m = new Main();
		m.run();
	}
} public class Main {
	void run() {
		Scanner scan = new Scanner(System.in);
		ArrayList<Integer> list = new ArrayList<Integer>();
		int n = scan.nextInt();
		int min = 0;
		int max = 0;
		long sum = 0;
		for (int i = 0; i < n; i++) {
			list.add(scan.nextInt());
			int num = list.get(i);
			if (i == 0) {
				min = num;
				max = num;
			}
			sum += num;
			min = Math.min(min, num);
			max = Math.max(max, num);
		}
		System.out.printf("%d %d %d\n", min, max, sum);
	}
	public static void main(String[] args) {
		Main m = new Main();
		m.run();
	}
} Main
import java.util.ArrayList;
import java.util.Scanner;

public class Main {
	void run() {
		Scanner scan = new Scanner(System.in);
		ArrayList<Integer> list = new ArrayList<Integer>();
		int n = scan.nextInt();
		int min = 0;
		int max = 0;
		long sum = 0;
		for (int i = 0; i < n; i++) {
			list.add(scan.nextInt());
			int num = list.get(i);
			if (i == 0) {
				min = num;
				max = num;
			}
			sum += num;
			min = Math.min(min, num);
			max = Math.max(max, num);
		}
		System.out.printf("%d %d %d\n", min, max, sum);
	}
	public static void main(String[] args) {
		Main m = new Main();
		m.run();
	}
}