import java.io.*;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int n = Integer.parseInt(br.readLine());
		String[] strs = br.readLine().split(" ");
		
		long min = 1000000;
		long max = -1000000;
		long total = 0;
		long num = 0;
		
		if (0 < n && n <= 10000) {
			for (int i = 0; i < n; i++) {
				num = Integer.parseInt(strs[i]);
				if (min > num) min = num;
				if (max < num) max = num;
				total += num;
			}
			
			System.out.println(min + " " + max + " " + total);
		}
	}
		
} import java.io.*; io.* java public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int n = Integer.parseInt(br.readLine());
		String[] strs = br.readLine().split(" ");
		
		long min = 1000000;
		long max = -1000000;
		long total = 0;
		long num = 0;
		
		if (0 < n && n <= 10000) {
			for (int i = 0; i < n; i++) {
				num = Integer.parseInt(strs[i]);
				if (min > num) min = num;
				if (max < num) max = num;
				total += num;
			}
			
			System.out.println(min + " " + max + " " + total);
		}
	}
		
} Main public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int n = Integer.parseInt(br.readLine());
		String[] strs = br.readLine().split(" ");
		
		long min = 1000000;
		long max = -1000000;
		long total = 0;
		long num = 0;
		
		if (0 < n && n <= 10000) {
			for (int i = 0; i < n; i++) {
				num = Integer.parseInt(strs[i]);
				if (min > num) min = num;
				if (max < num) max = num;
				total += num;
			}
			
			System.out.println(min + " " + max + " " + total);
		}
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int n = Integer.parseInt(br.readLine());
		String[] strs = br.readLine().split(" ");
		
		long min = 1000000;
		long max = -1000000;
		long total = 0;
		long num = 0;
		
		if (0 < n && n <= 10000) {
			for (int i = 0; i < n; i++) {
				num = Integer.parseInt(strs[i]);
				if (min > num) min = num;
				if (max < num) max = num;
				total += num;
			}
			
			System.out.println(min + " " + max + " " + total);
		}
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br String[] strs = br.readLine().split(" "); strs br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " long min = 1000000; min 1000000 long max = -1000000; max -1000000 1000000 long total = 0; total 0 long num = 0; num 0 if (0 < n && n <= 10000) {
			for (int i = 0; i < n; i++) {
				num = Integer.parseInt(strs[i]);
				if (min > num) min = num;
				if (max < num) max = num;
				total += num;
			}
			
			System.out.println(min + " " + max + " " + total);
		} 0 < n && n <= 10000 0 < n 0 n n <= 10000 n 10000 {
			for (int i = 0; i < n; i++) {
				num = Integer.parseInt(strs[i]);
				if (min > num) min = num;
				if (max < num) max = num;
				total += num;
			}
			
			System.out.println(min + " " + max + " " + total);
		} for (int i = 0; i < n; i++) {
				num = Integer.parseInt(strs[i]);
				if (min > num) min = num;
				if (max < num) max = num;
				total += num;
			} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
				num = Integer.parseInt(strs[i]);
				if (min > num) min = num;
				if (max < num) max = num;
				total += num;
			} {
				num = Integer.parseInt(strs[i]);
				if (min > num) min = num;
				if (max < num) max = num;
				total += num;
			} num = Integer.parseInt(strs[i]) num Integer.parseInt(strs[i]) Integer.parseInt Integer strs[i] strs i if (min > num) min = num; min > num min num min = num min num if (max < num) max = num; max < num max num max = num max num total += num total num System.out.println(min + " " + max + " " + total) System.out.println System.out System System.out min + " " + max + " " + total " " max min + " " + max + " " + total min " " max " " total String[] args args public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int n = Integer.parseInt(br.readLine());
		String[] strs = br.readLine().split(" ");
		
		long min = 1000000;
		long max = -1000000;
		long total = 0;
		long num = 0;
		
		if (0 < n && n <= 10000) {
			for (int i = 0; i < n; i++) {
				num = Integer.parseInt(strs[i]);
				if (min > num) min = num;
				if (max < num) max = num;
				total += num;
			}
			
			System.out.println(min + " " + max + " " + total);
		}
	}
		
} public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int n = Integer.parseInt(br.readLine());
		String[] strs = br.readLine().split(" ");
		
		long min = 1000000;
		long max = -1000000;
		long total = 0;
		long num = 0;
		
		if (0 < n && n <= 10000) {
			for (int i = 0; i < n; i++) {
				num = Integer.parseInt(strs[i]);
				if (min > num) min = num;
				if (max < num) max = num;
				total += num;
			}
			
			System.out.println(min + " " + max + " " + total);
		}
	}
		
} Main
import java.io.*;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int n = Integer.parseInt(br.readLine());
		String[] strs = br.readLine().split(" ");
		
		long min = 1000000;
		long max = -1000000;
		long total = 0;
		long num = 0;
		
		if (0 < n && n <= 10000) {
			for (int i = 0; i < n; i++) {
				num = Integer.parseInt(strs[i]);
				if (min > num) min = num;
				if (max < num) max = num;
				total += num;
			}
			
			System.out.println(min + " " + max + " " + total);
		}
	}
		
}