import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		long sum = 0;
		long min = 1000000;
		long max = -1000000;
		long a = 0;
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();

		for(int i = 1;i <= n;i++){
			a = scan.nextInt();
			if(a < min){
				min = 	a;
			}
			if(a > max){
				max = a;
			}
			sum += a;
		}
		System.out.println(min + " " + max + " " + sum);
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		long sum = 0;
		long min = 1000000;
		long max = -1000000;
		long a = 0;
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();

		for(int i = 1;i <= n;i++){
			a = scan.nextInt();
			if(a < min){
				min = 	a;
			}
			if(a > max){
				max = a;
			}
			sum += a;
		}
		System.out.println(min + " " + max + " " + sum);
	}

} Main public static void main(String[] args) {
		long sum = 0;
		long min = 1000000;
		long max = -1000000;
		long a = 0;
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();

		for(int i = 1;i <= n;i++){
			a = scan.nextInt();
			if(a < min){
				min = 	a;
			}
			if(a > max){
				max = a;
			}
			sum += a;
		}
		System.out.println(min + " " + max + " " + sum);
	} main {
		long sum = 0;
		long min = 1000000;
		long max = -1000000;
		long a = 0;
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();

		for(int i = 1;i <= n;i++){
			a = scan.nextInt();
			if(a < min){
				min = 	a;
			}
			if(a > max){
				max = a;
			}
			sum += a;
		}
		System.out.println(min + " " + max + " " + sum);
	} long sum = 0; sum 0 long min = 1000000; min 1000000 long max = -1000000; max -1000000 1000000 long a = 0; a 0 Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan for(int i = 1;i <= n;i++){
			a = scan.nextInt();
			if(a < min){
				min = 	a;
			}
			if(a > max){
				max = a;
			}
			sum += a;
		} int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
			a = scan.nextInt();
			if(a < min){
				min = 	a;
			}
			if(a > max){
				max = a;
			}
			sum += a;
		} {
			a = scan.nextInt();
			if(a < min){
				min = 	a;
			}
			if(a > max){
				max = a;
			}
			sum += a;
		} a = scan.nextInt() a scan.nextInt() scan.nextInt scan if(a < min){
				min = 	a;
			} a < min a min {
				min = 	a;
			} min = 	a min a if(a > max){
				max = a;
			} a > max a max {
				max = a;
			} max = a 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 public class Main {

	public static void main(String[] args) {
		long sum = 0;
		long min = 1000000;
		long max = -1000000;
		long a = 0;
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();

		for(int i = 1;i <= n;i++){
			a = scan.nextInt();
			if(a < min){
				min = 	a;
			}
			if(a > max){
				max = a;
			}
			sum += a;
		}
		System.out.println(min + " " + max + " " + sum);
	}

} public class Main {

	public static void main(String[] args) {
		long sum = 0;
		long min = 1000000;
		long max = -1000000;
		long a = 0;
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();

		for(int i = 1;i <= n;i++){
			a = scan.nextInt();
			if(a < min){
				min = 	a;
			}
			if(a > max){
				max = a;
			}
			sum += a;
		}
		System.out.println(min + " " + max + " " + sum);
	}

} Main
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		long sum = 0;
		long min = 1000000;
		long max = -1000000;
		long a = 0;
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();

		for(int i = 1;i <= n;i++){
			a = scan.nextInt();
			if(a < min){
				min = 	a;
			}
			if(a > max){
				max = a;
			}
			sum += a;
		}
		System.out.println(min + " " + max + " " + sum);
	}

}