import java.util.*;

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

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