import java.util.*;

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

class Main {
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int n = stdIn.nextInt();
		long sum = 0;
		int min = 1000000;
		int max = -1000000;
		for (int i=0; i<n; i++) {
			int a = stdIn.nextInt();
			min = Math.min(min,a);
			max = Math.max(max,a);
			sum += a;
		}
		System.out.println(min+" "+max+" "+sum);
	}
}