import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int min = 1000000;
        int max = -1000000;
		long sum = 0;
		int n = sc.nextInt();
		for (int cnt = 1; cnt <= n; cnt++) {
			int a = sc.nextInt();
			if (cnt == 1) {
				min = a;
				max = a;
				sum = a;
			} else if (a <= min) {
				min = a;
				sum = sum + a;
			} else if (a >= max) {
				max = a;
				sum = sum + a;
			} else {
				sum = sum + a;
			}
		}
		System.out.println(min + " " + max + " " + sum);
	}
}
 import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int min = 1000000;
        int max = -1000000;
		long sum = 0;
		int n = sc.nextInt();
		for (int cnt = 1; cnt <= n; cnt++) {
			int a = sc.nextInt();
			if (cnt == 1) {
				min = a;
				max = a;
				sum = a;
			} else if (a <= min) {
				min = a;
				sum = sum + a;
			} else if (a >= max) {
				max = a;
				sum = sum + a;
			} else {
				sum = sum + a;
			}
		}
		System.out.println(min + " " + max + " " + sum);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int min = 1000000;
        int max = -1000000;
		long sum = 0;
		int n = sc.nextInt();
		for (int cnt = 1; cnt <= n; cnt++) {
			int a = sc.nextInt();
			if (cnt == 1) {
				min = a;
				max = a;
				sum = a;
			} else if (a <= min) {
				min = a;
				sum = sum + a;
			} else if (a >= max) {
				max = a;
				sum = sum + a;
			} else {
				sum = sum + a;
			}
		}
		System.out.println(min + " " + max + " " + sum);
	} main {
		Scanner sc = new Scanner(System.in);
		int min = 1000000;
        int max = -1000000;
		long sum = 0;
		int n = sc.nextInt();
		for (int cnt = 1; cnt <= n; cnt++) {
			int a = sc.nextInt();
			if (cnt == 1) {
				min = a;
				max = a;
				sum = a;
			} else if (a <= min) {
				min = a;
				sum = sum + a;
			} else if (a >= max) {
				max = a;
				sum = sum + a;
			} else {
				sum = sum + a;
			}
		}
		System.out.println(min + " " + max + " " + sum);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int min = 1000000; min 1000000 int max = -1000000; max -1000000 1000000 long sum = 0; sum 0 int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc for (int cnt = 1; cnt <= n; cnt++) {
			int a = sc.nextInt();
			if (cnt == 1) {
				min = a;
				max = a;
				sum = a;
			} else if (a <= min) {
				min = a;
				sum = sum + a;
			} else if (a >= max) {
				max = a;
				sum = sum + a;
			} else {
				sum = sum + a;
			}
		} int cnt = 1; int cnt = 1; cnt 1 cnt <= n cnt n cnt++ cnt++ cnt {
			int a = sc.nextInt();
			if (cnt == 1) {
				min = a;
				max = a;
				sum = a;
			} else if (a <= min) {
				min = a;
				sum = sum + a;
			} else if (a >= max) {
				max = a;
				sum = sum + a;
			} else {
				sum = sum + a;
			}
		} {
			int a = sc.nextInt();
			if (cnt == 1) {
				min = a;
				max = a;
				sum = a;
			} else if (a <= min) {
				min = a;
				sum = sum + a;
			} else if (a >= max) {
				max = a;
				sum = sum + a;
			} else {
				sum = sum + a;
			}
		} int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc if (cnt == 1) {
				min = a;
				max = a;
				sum = a;
			} else if (a <= min) {
				min = a;
				sum = sum + a;
			} else if (a >= max) {
				max = a;
				sum = sum + a;
			} else {
				sum = sum + a;
			} cnt == 1 cnt 1 {
				min = a;
				max = a;
				sum = a;
			} min = a min a max = a max a sum = a sum a if (a <= min) {
				min = a;
				sum = sum + a;
			} else if (a >= max) {
				max = a;
				sum = sum + a;
			} else {
				sum = sum + a;
			} a <= min a min {
				min = a;
				sum = sum + a;
			} min = a min a sum = sum + a sum sum + a sum a if (a >= max) {
				max = a;
				sum = sum + a;
			} else {
				sum = sum + a;
			} a >= max a max {
				max = a;
				sum = sum + a;
			} max = a max a sum = sum + a sum sum + a sum a {
				sum = sum + a;
			} sum = sum + a sum sum + a sum a 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 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int min = 1000000;
        int max = -1000000;
		long sum = 0;
		int n = sc.nextInt();
		for (int cnt = 1; cnt <= n; cnt++) {
			int a = sc.nextInt();
			if (cnt == 1) {
				min = a;
				max = a;
				sum = a;
			} else if (a <= min) {
				min = a;
				sum = sum + a;
			} else if (a >= max) {
				max = a;
				sum = sum + a;
			} else {
				sum = sum + a;
			}
		}
		System.out.println(min + " " + max + " " + sum);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int min = 1000000;
        int max = -1000000;
		long sum = 0;
		int n = sc.nextInt();
		for (int cnt = 1; cnt <= n; cnt++) {
			int a = sc.nextInt();
			if (cnt == 1) {
				min = a;
				max = a;
				sum = a;
			} else if (a <= min) {
				min = a;
				sum = sum + a;
			} else if (a >= max) {
				max = a;
				sum = sum + a;
			} else {
				sum = sum + a;
			}
		}
		System.out.println(min + " " + max + " " + sum);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int min = 1000000;
        int max = -1000000;
		long sum = 0;
		int n = sc.nextInt();
		for (int cnt = 1; cnt <= n; cnt++) {
			int a = sc.nextInt();
			if (cnt == 1) {
				min = a;
				max = a;
				sum = a;
			} else if (a <= min) {
				min = a;
				sum = sum + a;
			} else if (a >= max) {
				max = a;
				sum = sum + a;
			} else {
				sum = sum + a;
			}
		}
		System.out.println(min + " " + max + " " + sum);
	}
}

