import java.util.*;
import java.io.*;

class Main {
	static PrintStream out = System.out;
	static Scanner in = new Scanner(System.in);

	public static void main(String[] args) {
		int n = in.nextInt();
		int a = in.nextInt();
		long min = a,max = a,sum = a;
		for (int i = 1; i < n; i++) {
			a = in.nextInt();
			min = Math.min(a, min);
			max = Math.max(a, max);
			sum += a;
		}
		out.println(String.format("%d %d %d", min, max, sum));
	}
} import java.util.*; util.* java import java.io.*; io.* java class Main {
	static PrintStream out = System.out;
	static Scanner in = new Scanner(System.in);

	public static void main(String[] args) {
		int n = in.nextInt();
		int a = in.nextInt();
		long min = a,max = a,sum = a;
		for (int i = 1; i < n; i++) {
			a = in.nextInt();
			min = Math.min(a, min);
			max = Math.max(a, max);
			sum += a;
		}
		out.println(String.format("%d %d %d", min, max, sum));
	}
} Main static PrintStream out = System.out; out System.out System System.out static Scanner in = new Scanner(System.in); in new Scanner(System.in) public static void main(String[] args) {
		int n = in.nextInt();
		int a = in.nextInt();
		long min = a,max = a,sum = a;
		for (int i = 1; i < n; i++) {
			a = in.nextInt();
			min = Math.min(a, min);
			max = Math.max(a, max);
			sum += a;
		}
		out.println(String.format("%d %d %d", min, max, sum));
	} main {
		int n = in.nextInt();
		int a = in.nextInt();
		long min = a,max = a,sum = a;
		for (int i = 1; i < n; i++) {
			a = in.nextInt();
			min = Math.min(a, min);
			max = Math.max(a, max);
			sum += a;
		}
		out.println(String.format("%d %d %d", min, max, sum));
	} int n = in.nextInt(); n in.nextInt() in.nextInt in int a = in.nextInt(); a in.nextInt() in.nextInt in long min = a min a max = a max a sum = a; sum a for (int i = 1; i < n; i++) {
			a = in.nextInt();
			min = Math.min(a, min);
			max = Math.max(a, max);
			sum += a;
		} int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
			a = in.nextInt();
			min = Math.min(a, min);
			max = Math.max(a, max);
			sum += a;
		} {
			a = in.nextInt();
			min = Math.min(a, min);
			max = Math.max(a, max);
			sum += a;
		} a = in.nextInt() a in.nextInt() in.nextInt in min = Math.min(a, min) min Math.min(a, min) Math.min Math a min max = Math.max(a, max) max Math.max(a, max) Math.max Math a max sum += a sum a out.println(String.format("%d %d %d", min, max, sum)) out.println out String.format("%d %d %d", min, max, sum) String.format String "%d %d %d" min max sum String[] args args
import java.util.*;
import java.io.*;

class Main {
	static PrintStream out = System.out;
	static Scanner in = new Scanner(System.in);

	public static void main(String[] args) {
		int n = in.nextInt();
		int a = in.nextInt();
		long min = a,max = a,sum = a;
		for (int i = 1; i < n; i++) {
			a = in.nextInt();
			min = Math.min(a, min);
			max = Math.max(a, max);
			sum += a;
		}
		out.println(String.format("%d %d %d", min, max, sum));
	}
}