import java.util.Scanner;

public class Main{
	public static void main(String[] args){

		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();
		int min = 0;
		int max = 0;
		long amount = 0;

		for(int i = 0; i < n; i++){
			int x = scan.nextInt();
			if(i == 0){
				min = x;
				max = x;
				amount = x;
			}else{
				if(x < min){
					min = x;
				}else if(x > max){
					max = x;
				}
				amount = amount + x;
			}
		}
		System.out.println(min + " " + max + " " + amount);
	}
} import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[] args){

		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();
		int min = 0;
		int max = 0;
		long amount = 0;

		for(int i = 0; i < n; i++){
			int x = scan.nextInt();
			if(i == 0){
				min = x;
				max = x;
				amount = x;
			}else{
				if(x < min){
					min = x;
				}else if(x > max){
					max = x;
				}
				amount = amount + x;
			}
		}
		System.out.println(min + " " + max + " " + amount);
	}
} Main public static void main(String[] args){

		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();
		int min = 0;
		int max = 0;
		long amount = 0;

		for(int i = 0; i < n; i++){
			int x = scan.nextInt();
			if(i == 0){
				min = x;
				max = x;
				amount = x;
			}else{
				if(x < min){
					min = x;
				}else if(x > max){
					max = x;
				}
				amount = amount + x;
			}
		}
		System.out.println(min + " " + max + " " + amount);
	} main {

		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();
		int min = 0;
		int max = 0;
		long amount = 0;

		for(int i = 0; i < n; i++){
			int x = scan.nextInt();
			if(i == 0){
				min = x;
				max = x;
				amount = x;
			}else{
				if(x < min){
					min = x;
				}else if(x > max){
					max = x;
				}
				amount = amount + x;
			}
		}
		System.out.println(min + " " + max + " " + amount);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int min = 0; min 0 int max = 0; max 0 long amount = 0; amount 0 for(int i = 0; i < n; i++){
			int x = scan.nextInt();
			if(i == 0){
				min = x;
				max = x;
				amount = x;
			}else{
				if(x < min){
					min = x;
				}else if(x > max){
					max = x;
				}
				amount = amount + x;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			int x = scan.nextInt();
			if(i == 0){
				min = x;
				max = x;
				amount = x;
			}else{
				if(x < min){
					min = x;
				}else if(x > max){
					max = x;
				}
				amount = amount + x;
			}
		} {
			int x = scan.nextInt();
			if(i == 0){
				min = x;
				max = x;
				amount = x;
			}else{
				if(x < min){
					min = x;
				}else if(x > max){
					max = x;
				}
				amount = amount + x;
			}
		} int x = scan.nextInt(); x scan.nextInt() scan.nextInt scan if(i == 0){
				min = x;
				max = x;
				amount = x;
			}else{
				if(x < min){
					min = x;
				}else if(x > max){
					max = x;
				}
				amount = amount + x;
			} i == 0 i 0 {
				min = x;
				max = x;
				amount = x;
			} min = x min x max = x max x amount = x amount x {
				if(x < min){
					min = x;
				}else if(x > max){
					max = x;
				}
				amount = amount + x;
			} if(x < min){
					min = x;
				}else if(x > max){
					max = x;
				} x < min x min {
					min = x;
				} min = x min x if(x > max){
					max = x;
				} x > max x max {
					max = x;
				} max = x max x amount = amount + x amount amount + x amount x System.out.println(min + " " + max + " " + amount) System.out.println System.out System System.out min + " " + max + " " + amount " " max min + " " + max + " " + amount min " " max " " amount String[] args args public class Main{
	public static void main(String[] args){

		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();
		int min = 0;
		int max = 0;
		long amount = 0;

		for(int i = 0; i < n; i++){
			int x = scan.nextInt();
			if(i == 0){
				min = x;
				max = x;
				amount = x;
			}else{
				if(x < min){
					min = x;
				}else if(x > max){
					max = x;
				}
				amount = amount + x;
			}
		}
		System.out.println(min + " " + max + " " + amount);
	}
} public class Main{
	public static void main(String[] args){

		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();
		int min = 0;
		int max = 0;
		long amount = 0;

		for(int i = 0; i < n; i++){
			int x = scan.nextInt();
			if(i == 0){
				min = x;
				max = x;
				amount = x;
			}else{
				if(x < min){
					min = x;
				}else if(x > max){
					max = x;
				}
				amount = amount + x;
			}
		}
		System.out.println(min + " " + max + " " + amount);
	}
} Main
import java.util.Scanner;

public class Main{
	public static void main(String[] args){

		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();
		int min = 0;
		int max = 0;
		long amount = 0;

		for(int i = 0; i < n; i++){
			int x = scan.nextInt();
			if(i == 0){
				min = x;
				max = x;
				amount = x;
			}else{
				if(x < min){
					min = x;
				}else if(x > max){
					max = x;
				}
				amount = amount + x;
			}
		}
		System.out.println(min + " " + max + " " + amount);
	}
}