import java.util.Scanner;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;


class Main {

	public static void main(String[] args) {
	
		Scanner sc = new Scanner(System.in);
		
		ArrayList<Integer> array = new ArrayList<Integer>();
		
		long sum = 0;
		int n = sc.nextInt();
		int a;
		
		if(0 < n && n <= 10000){
			
			for(int i = 0; i < n; i++){
				
				a = sc.nextInt();
				
				if(-1000000 <= a && a <= 1000000){
					array.add(a);
					sum = sum + a;
				}
				
			}
			
			Collections.sort(array);
			
			int na = array.size() - 1;
			int max = array.get(na);
			int min = array.get(0);
			
			System.out.println(min + " " + max + " " + sum);
		}
		
	}

} import java.util.Scanner; Scanner java.util import java.util.ArrayList; ArrayList java.util import java.util.Arrays; Arrays java.util import java.util.Collections; Collections java.util class Main {

	public static void main(String[] args) {
	
		Scanner sc = new Scanner(System.in);
		
		ArrayList<Integer> array = new ArrayList<Integer>();
		
		long sum = 0;
		int n = sc.nextInt();
		int a;
		
		if(0 < n && n <= 10000){
			
			for(int i = 0; i < n; i++){
				
				a = sc.nextInt();
				
				if(-1000000 <= a && a <= 1000000){
					array.add(a);
					sum = sum + a;
				}
				
			}
			
			Collections.sort(array);
			
			int na = array.size() - 1;
			int max = array.get(na);
			int min = array.get(0);
			
			System.out.println(min + " " + max + " " + sum);
		}
		
	}

} Main public static void main(String[] args) {
	
		Scanner sc = new Scanner(System.in);
		
		ArrayList<Integer> array = new ArrayList<Integer>();
		
		long sum = 0;
		int n = sc.nextInt();
		int a;
		
		if(0 < n && n <= 10000){
			
			for(int i = 0; i < n; i++){
				
				a = sc.nextInt();
				
				if(-1000000 <= a && a <= 1000000){
					array.add(a);
					sum = sum + a;
				}
				
			}
			
			Collections.sort(array);
			
			int na = array.size() - 1;
			int max = array.get(na);
			int min = array.get(0);
			
			System.out.println(min + " " + max + " " + sum);
		}
		
	} main {
	
		Scanner sc = new Scanner(System.in);
		
		ArrayList<Integer> array = new ArrayList<Integer>();
		
		long sum = 0;
		int n = sc.nextInt();
		int a;
		
		if(0 < n && n <= 10000){
			
			for(int i = 0; i < n; i++){
				
				a = sc.nextInt();
				
				if(-1000000 <= a && a <= 1000000){
					array.add(a);
					sum = sum + a;
				}
				
			}
			
			Collections.sort(array);
			
			int na = array.size() - 1;
			int max = array.get(na);
			int min = array.get(0);
			
			System.out.println(min + " " + max + " " + sum);
		}
		
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) ArrayList<Integer> array = new ArrayList<Integer>(); array new ArrayList<Integer>() long sum = 0; sum 0 int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int a; a if(0 < n && n <= 10000){
			
			for(int i = 0; i < n; i++){
				
				a = sc.nextInt();
				
				if(-1000000 <= a && a <= 1000000){
					array.add(a);
					sum = sum + a;
				}
				
			}
			
			Collections.sort(array);
			
			int na = array.size() - 1;
			int max = array.get(na);
			int min = array.get(0);
			
			System.out.println(min + " " + max + " " + sum);
		} 0 < n && n <= 10000 0 < n 0 n n <= 10000 n 10000 {
			
			for(int i = 0; i < n; i++){
				
				a = sc.nextInt();
				
				if(-1000000 <= a && a <= 1000000){
					array.add(a);
					sum = sum + a;
				}
				
			}
			
			Collections.sort(array);
			
			int na = array.size() - 1;
			int max = array.get(na);
			int min = array.get(0);
			
			System.out.println(min + " " + max + " " + sum);
		} for(int i = 0; i < n; i++){
				
				a = sc.nextInt();
				
				if(-1000000 <= a && a <= 1000000){
					array.add(a);
					sum = sum + a;
				}
				
			} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
				
				a = sc.nextInt();
				
				if(-1000000 <= a && a <= 1000000){
					array.add(a);
					sum = sum + a;
				}
				
			} {
				
				a = sc.nextInt();
				
				if(-1000000 <= a && a <= 1000000){
					array.add(a);
					sum = sum + a;
				}
				
			} a = sc.nextInt() a sc.nextInt() sc.nextInt sc if(-1000000 <= a && a <= 1000000){
					array.add(a);
					sum = sum + a;
				} -1000000 <= a && a <= 1000000 -1000000 <= a -1000000 1000000 a a <= 1000000 a 1000000 {
					array.add(a);
					sum = sum + a;
				} array.add(a) array.add array a sum = sum + a sum sum + a sum a Collections.sort(array) Collections.sort Collections array int na = array.size() - 1; na array.size() - 1 array.size() array.size array 1 int max = array.get(na); max array.get(na) array.get array na int min = array.get(0); min array.get(0) array.get array 0 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
import java.util.Scanner;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;


class Main {

	public static void main(String[] args) {
	
		Scanner sc = new Scanner(System.in);
		
		ArrayList<Integer> array = new ArrayList<Integer>();
		
		long sum = 0;
		int n = sc.nextInt();
		int a;
		
		if(0 < n && n <= 10000){
			
			for(int i = 0; i < n; i++){
				
				a = sc.nextInt();
				
				if(-1000000 <= a && a <= 1000000){
					array.add(a);
					sum = sum + a;
				}
				
			}
			
			Collections.sort(array);
			
			int na = array.size() - 1;
			int max = array.get(na);
			int min = array.get(0);
			
			System.out.println(min + " " + max + " " + sum);
		}
		
	}

}