import java.util.Scanner;

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

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