import java.util.Scanner;

public class Main {

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

		n = sc.nextInt();
		sc.hasNext();

		for(int i=0;i<n;i++){
			x = sc.nextInt();
			if(min > x){
				min = x;
			}
			if(x > max){
				max = x;
			}
			sum += x;
		}

		System.out.println(min +" "+ max +" "+ sum);
		sc.close();
	}

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

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

		n = sc.nextInt();
		sc.hasNext();

		for(int i=0;i<n;i++){
			x = sc.nextInt();
			if(min > x){
				min = x;
			}
			if(x > max){
				max = x;
			}
			sum += x;
		}

		System.out.println(min +" "+ max +" "+ sum);
		sc.close();
	}

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

		n = sc.nextInt();
		sc.hasNext();

		for(int i=0;i<n;i++){
			x = sc.nextInt();
			if(min > x){
				min = x;
			}
			if(x > max){
				max = x;
			}
			sum += x;
		}

		System.out.println(min +" "+ max +" "+ sum);
		sc.close();
	} main {
		int n,x;
		int max = -1000000;
		int min = 1000000;
		long sum = 0;
		Scanner sc = new Scanner(System.in);

		n = sc.nextInt();
		sc.hasNext();

		for(int i=0;i<n;i++){
			x = sc.nextInt();
			if(min > x){
				min = x;
			}
			if(x > max){
				max = x;
			}
			sum += x;
		}

		System.out.println(min +" "+ max +" "+ sum);
		sc.close();
	} int n n x; x int max = -1000000; max -1000000 1000000 int min = 1000000; min 1000000 long sum = 0; sum 0 Scanner sc = new Scanner(System.in); sc new Scanner(System.in) n = sc.nextInt() n sc.nextInt() sc.nextInt sc sc.hasNext() sc.hasNext sc for(int i=0;i<n;i++){
			x = sc.nextInt();
			if(min > x){
				min = x;
			}
			if(x > max){
				max = x;
			}
			sum += x;
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			x = sc.nextInt();
			if(min > x){
				min = x;
			}
			if(x > max){
				max = x;
			}
			sum += x;
		} {
			x = sc.nextInt();
			if(min > x){
				min = x;
			}
			if(x > max){
				max = x;
			}
			sum += x;
		} x = sc.nextInt() x sc.nextInt() sc.nextInt sc if(min > x){
				min = x;
			} min > x min x {
				min = x;
			} min = x min x if(x > max){
				max = x;
			} x > max x max {
				max = x;
			} max = x max x sum += x sum x 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 {

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

		n = sc.nextInt();
		sc.hasNext();

		for(int i=0;i<n;i++){
			x = sc.nextInt();
			if(min > x){
				min = x;
			}
			if(x > max){
				max = x;
			}
			sum += x;
		}

		System.out.println(min +" "+ max +" "+ sum);
		sc.close();
	}

} public class Main {

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

		n = sc.nextInt();
		sc.hasNext();

		for(int i=0;i<n;i++){
			x = sc.nextInt();
			if(min > x){
				min = x;
			}
			if(x > max){
				max = x;
			}
			sum += x;
		}

		System.out.println(min +" "+ max +" "+ sum);
		sc.close();
	}

} Main
import java.util.Scanner;

public class Main {

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

		n = sc.nextInt();
		sc.hasNext();

		for(int i=0;i<n;i++){
			x = sc.nextInt();
			if(min > x){
				min = x;
			}
			if(x > max){
				max = x;
			}
			sum += x;
		}

		System.out.println(min +" "+ max +" "+ sum);
		sc.close();
	}

}