

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int[] b = new int[a];
		int c = Integer.MAX_VALUE;
		int d = Integer.MIN_VALUE;
		long e = 0;
		for (int i = 0; i < a; i++) {
			int f = scanner.nextInt();
			c = Math.min(c, f);
			d = Math.max(d, f);
			e += f;
		}
		System.out.println(String.format("%d %d %d", c, d, e));

	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int[] b = new int[a];
		int c = Integer.MAX_VALUE;
		int d = Integer.MIN_VALUE;
		long e = 0;
		for (int i = 0; i < a; i++) {
			int f = scanner.nextInt();
			c = Math.min(c, f);
			d = Math.max(d, f);
			e += f;
		}
		System.out.println(String.format("%d %d %d", c, d, e));

	}
} Main public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int[] b = new int[a];
		int c = Integer.MAX_VALUE;
		int d = Integer.MIN_VALUE;
		long e = 0;
		for (int i = 0; i < a; i++) {
			int f = scanner.nextInt();
			c = Math.min(c, f);
			d = Math.max(d, f);
			e += f;
		}
		System.out.println(String.format("%d %d %d", c, d, e));

	} main {
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int[] b = new int[a];
		int c = Integer.MAX_VALUE;
		int d = Integer.MIN_VALUE;
		long e = 0;
		for (int i = 0; i < a; i++) {
			int f = scanner.nextInt();
			c = Math.min(c, f);
			d = Math.max(d, f);
			e += f;
		}
		System.out.println(String.format("%d %d %d", c, d, e));

	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int a = scanner.nextInt(); a scanner.nextInt() scanner.nextInt scanner int[] b = new int[a]; b new int[a] a int c = Integer.MAX_VALUE; c Integer.MAX_VALUE Integer Integer.MAX_VALUE int d = Integer.MIN_VALUE; d Integer.MIN_VALUE Integer Integer.MIN_VALUE long e = 0; e 0 for (int i = 0; i < a; i++) {
			int f = scanner.nextInt();
			c = Math.min(c, f);
			d = Math.max(d, f);
			e += f;
		} int i = 0; int i = 0; i 0 i < a i a i++ i++ i {
			int f = scanner.nextInt();
			c = Math.min(c, f);
			d = Math.max(d, f);
			e += f;
		} {
			int f = scanner.nextInt();
			c = Math.min(c, f);
			d = Math.max(d, f);
			e += f;
		} int f = scanner.nextInt(); f scanner.nextInt() scanner.nextInt scanner c = Math.min(c, f) c Math.min(c, f) Math.min Math c f d = Math.max(d, f) d Math.max(d, f) Math.max Math d f e += f e f System.out.println(String.format("%d %d %d", c, d, e)) System.out.println System.out System System.out String.format("%d %d %d", c, d, e) String.format String "%d %d %d" c d e String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int[] b = new int[a];
		int c = Integer.MAX_VALUE;
		int d = Integer.MIN_VALUE;
		long e = 0;
		for (int i = 0; i < a; i++) {
			int f = scanner.nextInt();
			c = Math.min(c, f);
			d = Math.max(d, f);
			e += f;
		}
		System.out.println(String.format("%d %d %d", c, d, e));

	}
} public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int[] b = new int[a];
		int c = Integer.MAX_VALUE;
		int d = Integer.MIN_VALUE;
		long e = 0;
		for (int i = 0; i < a; i++) {
			int f = scanner.nextInt();
			c = Math.min(c, f);
			d = Math.max(d, f);
			e += f;
		}
		System.out.println(String.format("%d %d %d", c, d, e));

	}
} Main


import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int[] b = new int[a];
		int c = Integer.MAX_VALUE;
		int d = Integer.MIN_VALUE;
		long e = 0;
		for (int i = 0; i < a; i++) {
			int f = scanner.nextInt();
			c = Math.min(c, f);
			d = Math.max(d, f);
			e += f;
		}
		System.out.println(String.format("%d %d %d", c, d, e));

	}
}