import java.util.Scanner;

public class Main {
	private static Scanner sc;

	public static void main(String[] args) {
		sc = new Scanner(System.in);
		int n = sc.nextInt();
		long min = 0;
		long max = 0;
		long sum = 0;
		for (int i = 0; i < n; i++) {
			int num = Integer.parseInt(sc.next());
			if (num <= min || i == 0) {
				min = num;
			}
			if (max <= num || i == 0) {
				max = num;
			}
			sum += num;
		}
		System.out.println(min + " " + max + " " + sum);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	private static Scanner sc;

	public static void main(String[] args) {
		sc = new Scanner(System.in);
		int n = sc.nextInt();
		long min = 0;
		long max = 0;
		long sum = 0;
		for (int i = 0; i < n; i++) {
			int num = Integer.parseInt(sc.next());
			if (num <= min || i == 0) {
				min = num;
			}
			if (max <= num || i == 0) {
				max = num;
			}
			sum += num;
		}
		System.out.println(min + " " + max + " " + sum);
	}
} Main private static Scanner sc; sc public static void main(String[] args) {
		sc = new Scanner(System.in);
		int n = sc.nextInt();
		long min = 0;
		long max = 0;
		long sum = 0;
		for (int i = 0; i < n; i++) {
			int num = Integer.parseInt(sc.next());
			if (num <= min || i == 0) {
				min = num;
			}
			if (max <= num || i == 0) {
				max = num;
			}
			sum += num;
		}
		System.out.println(min + " " + max + " " + sum);
	} main {
		sc = new Scanner(System.in);
		int n = sc.nextInt();
		long min = 0;
		long max = 0;
		long sum = 0;
		for (int i = 0; i < n; i++) {
			int num = Integer.parseInt(sc.next());
			if (num <= min || i == 0) {
				min = num;
			}
			if (max <= num || i == 0) {
				max = num;
			}
			sum += num;
		}
		System.out.println(min + " " + max + " " + sum);
	} sc = new Scanner(System.in) sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc long min = 0; min 0 long max = 0; max 0 long sum = 0; sum 0 for (int i = 0; i < n; i++) {
			int num = Integer.parseInt(sc.next());
			if (num <= min || i == 0) {
				min = num;
			}
			if (max <= num || i == 0) {
				max = num;
			}
			sum += num;
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			int num = Integer.parseInt(sc.next());
			if (num <= min || i == 0) {
				min = num;
			}
			if (max <= num || i == 0) {
				max = num;
			}
			sum += num;
		} {
			int num = Integer.parseInt(sc.next());
			if (num <= min || i == 0) {
				min = num;
			}
			if (max <= num || i == 0) {
				max = num;
			}
			sum += num;
		} int num = Integer.parseInt(sc.next()); num Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc if (num <= min || i == 0) {
				min = num;
			} num <= min || i == 0 num <= min num min i == 0 i 0 {
				min = num;
			} min = num min num if (max <= num || i == 0) {
				max = num;
			} max <= num || i == 0 max <= num max num i == 0 i 0 {
				max = num;
			} max = num max num sum += num sum num 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 {
	private static Scanner sc;

	public static void main(String[] args) {
		sc = new Scanner(System.in);
		int n = sc.nextInt();
		long min = 0;
		long max = 0;
		long sum = 0;
		for (int i = 0; i < n; i++) {
			int num = Integer.parseInt(sc.next());
			if (num <= min || i == 0) {
				min = num;
			}
			if (max <= num || i == 0) {
				max = num;
			}
			sum += num;
		}
		System.out.println(min + " " + max + " " + sum);
	}
} public class Main {
	private static Scanner sc;

	public static void main(String[] args) {
		sc = new Scanner(System.in);
		int n = sc.nextInt();
		long min = 0;
		long max = 0;
		long sum = 0;
		for (int i = 0; i < n; i++) {
			int num = Integer.parseInt(sc.next());
			if (num <= min || i == 0) {
				min = num;
			}
			if (max <= num || i == 0) {
				max = num;
			}
			sum += num;
		}
		System.out.println(min + " " + max + " " + sum);
	}
} Main
import java.util.Scanner;

public class Main {
	private static Scanner sc;

	public static void main(String[] args) {
		sc = new Scanner(System.in);
		int n = sc.nextInt();
		long min = 0;
		long max = 0;
		long sum = 0;
		for (int i = 0; i < n; i++) {
			int num = Integer.parseInt(sc.next());
			if (num <= min || i == 0) {
				min = num;
			}
			if (max <= num || i == 0) {
				max = num;
			}
			sum += num;
		}
		System.out.println(min + " " + max + " " + sum);
	}
}