import java.text.DecimalFormat;
import java.util.Scanner;

public class Main {
	
	static DecimalFormat df = new DecimalFormat("0.0000000000000000000");
	
	public static void main (String[] args) {

		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt(), min = Integer.MAX_VALUE, max = Integer.MIN_VALUE;
		long sum = 0;
		for (int i = 0; i < n; i++) {
			int a = sc.nextInt();
			min = Math.min(min, a);
			max = Math.max(max, a);
			sum += a;
		}
		
		System.out.println(min + " " + max + " " + sum);
		
		sc.close();
	}

} import java.text.DecimalFormat; DecimalFormat java.text import java.util.Scanner; Scanner java.util public class Main {
	
	static DecimalFormat df = new DecimalFormat("0.0000000000000000000");
	
	public static void main (String[] args) {

		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt(), min = Integer.MAX_VALUE, max = Integer.MIN_VALUE;
		long sum = 0;
		for (int i = 0; i < n; i++) {
			int a = sc.nextInt();
			min = Math.min(min, a);
			max = Math.max(max, a);
			sum += a;
		}
		
		System.out.println(min + " " + max + " " + sum);
		
		sc.close();
	}

} Main static DecimalFormat df = new DecimalFormat("0.0000000000000000000"); df new DecimalFormat("0.0000000000000000000") public static void main (String[] args) {

		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt(), min = Integer.MAX_VALUE, max = Integer.MIN_VALUE;
		long sum = 0;
		for (int i = 0; i < n; i++) {
			int a = sc.nextInt();
			min = Math.min(min, a);
			max = Math.max(max, a);
			sum += a;
		}
		
		System.out.println(min + " " + max + " " + sum);
		
		sc.close();
	} main {

		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt(), min = Integer.MAX_VALUE, max = Integer.MIN_VALUE;
		long sum = 0;
		for (int i = 0; i < n; i++) {
			int a = sc.nextInt();
			min = Math.min(min, a);
			max = Math.max(max, a);
			sum += a;
		}
		
		System.out.println(min + " " + max + " " + sum);
		
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt() n sc.nextInt() sc.nextInt sc min = Integer.MAX_VALUE min Integer.MAX_VALUE Integer Integer.MAX_VALUE max = Integer.MIN_VALUE; max Integer.MIN_VALUE Integer Integer.MIN_VALUE long sum = 0; sum 0 for (int i = 0; i < n; i++) {
			int a = sc.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 = sc.nextInt();
			min = Math.min(min, a);
			max = Math.max(max, a);
			sum += a;
		} {
			int a = sc.nextInt();
			min = Math.min(min, a);
			max = Math.max(max, a);
			sum += a;
		} int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc 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 sc.close() sc.close sc String[] args args public class Main {
	
	static DecimalFormat df = new DecimalFormat("0.0000000000000000000");
	
	public static void main (String[] args) {

		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt(), min = Integer.MAX_VALUE, max = Integer.MIN_VALUE;
		long sum = 0;
		for (int i = 0; i < n; i++) {
			int a = sc.nextInt();
			min = Math.min(min, a);
			max = Math.max(max, a);
			sum += a;
		}
		
		System.out.println(min + " " + max + " " + sum);
		
		sc.close();
	}

} public class Main {
	
	static DecimalFormat df = new DecimalFormat("0.0000000000000000000");
	
	public static void main (String[] args) {

		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt(), min = Integer.MAX_VALUE, max = Integer.MIN_VALUE;
		long sum = 0;
		for (int i = 0; i < n; i++) {
			int a = sc.nextInt();
			min = Math.min(min, a);
			max = Math.max(max, a);
			sum += a;
		}
		
		System.out.println(min + " " + max + " " + sum);
		
		sc.close();
	}

} Main
import java.text.DecimalFormat;
import java.util.Scanner;

public class Main {
	
	static DecimalFormat df = new DecimalFormat("0.0000000000000000000");
	
	public static void main (String[] args) {

		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt(), min = Integer.MAX_VALUE, max = Integer.MIN_VALUE;
		long sum = 0;
		for (int i = 0; i < n; i++) {
			int a = sc.nextInt();
			min = Math.min(min, a);
			max = Math.max(max, a);
			sum += a;
		}
		
		System.out.println(min + " " + max + " " + sum);
		
		sc.close();
	}

}