import java.util.Scanner;

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

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