import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main{
	public static void main(String[] args)throws Exception{
		long add=0;
	
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line1 = br.readLine();
		String[] line2 = br.readLine().split(" ");
		StringBuilder sb = new StringBuilder();
		
		int n = Integer.parseInt(line1);
		int[] a = new int[n];
		int min = Integer.MAX_VALUE;
		int max = Integer.MIN_VALUE;
		
		for(int i=0; i<n; i++){
			a[i] = Integer.parseInt(line2[i]);
			if(a[i] < min){
				min = a[i];
			}	if(a[i] > max){
				max = a[i];
			}
			add += a[i];
		}
		System.out.println(min+" "+ max+" "+ add);		
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.IOException; IOException java.io public class Main{
	public static void main(String[] args)throws Exception{
		long add=0;
	
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line1 = br.readLine();
		String[] line2 = br.readLine().split(" ");
		StringBuilder sb = new StringBuilder();
		
		int n = Integer.parseInt(line1);
		int[] a = new int[n];
		int min = Integer.MAX_VALUE;
		int max = Integer.MIN_VALUE;
		
		for(int i=0; i<n; i++){
			a[i] = Integer.parseInt(line2[i]);
			if(a[i] < min){
				min = a[i];
			}	if(a[i] > max){
				max = a[i];
			}
			add += a[i];
		}
		System.out.println(min+" "+ max+" "+ add);		
	}
} Main public static void main(String[] args)throws Exception{
		long add=0;
	
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line1 = br.readLine();
		String[] line2 = br.readLine().split(" ");
		StringBuilder sb = new StringBuilder();
		
		int n = Integer.parseInt(line1);
		int[] a = new int[n];
		int min = Integer.MAX_VALUE;
		int max = Integer.MIN_VALUE;
		
		for(int i=0; i<n; i++){
			a[i] = Integer.parseInt(line2[i]);
			if(a[i] < min){
				min = a[i];
			}	if(a[i] > max){
				max = a[i];
			}
			add += a[i];
		}
		System.out.println(min+" "+ max+" "+ add);		
	} main {
		long add=0;
	
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line1 = br.readLine();
		String[] line2 = br.readLine().split(" ");
		StringBuilder sb = new StringBuilder();
		
		int n = Integer.parseInt(line1);
		int[] a = new int[n];
		int min = Integer.MAX_VALUE;
		int max = Integer.MIN_VALUE;
		
		for(int i=0; i<n; i++){
			a[i] = Integer.parseInt(line2[i]);
			if(a[i] < min){
				min = a[i];
			}	if(a[i] > max){
				max = a[i];
			}
			add += a[i];
		}
		System.out.println(min+" "+ max+" "+ add);		
	} long add=0; add 0 BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String line1 = br.readLine(); line1 br.readLine() br.readLine br String[] line2 = br.readLine().split(" "); line2 br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " StringBuilder sb = new StringBuilder(); sb new StringBuilder() int n = Integer.parseInt(line1); n Integer.parseInt(line1) Integer.parseInt Integer line1 int[] a = new int[n]; a new int[n] n int min = Integer.MAX_VALUE; min Integer.MAX_VALUE Integer Integer.MAX_VALUE int max = Integer.MIN_VALUE; max Integer.MIN_VALUE Integer Integer.MIN_VALUE for(int i=0; i<n; i++){
			a[i] = Integer.parseInt(line2[i]);
			if(a[i] < min){
				min = a[i];
			}	if(a[i] > max){
				max = a[i];
			}
			add += a[i];
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			a[i] = Integer.parseInt(line2[i]);
			if(a[i] < min){
				min = a[i];
			}	if(a[i] > max){
				max = a[i];
			}
			add += a[i];
		} {
			a[i] = Integer.parseInt(line2[i]);
			if(a[i] < min){
				min = a[i];
			}	if(a[i] > max){
				max = a[i];
			}
			add += a[i];
		} a[i] = Integer.parseInt(line2[i]) a[i] a i Integer.parseInt(line2[i]) Integer.parseInt Integer line2[i] line2 i if(a[i] < min){
				min = a[i];
			} a[i] < min a[i] a i min {
				min = a[i];
			} min = a[i] min a[i] a i if(a[i] > max){
				max = a[i];
			} a[i] > max a[i] a i max {
				max = a[i];
			} max = a[i] max a[i] a i add += a[i] add a[i] a i System.out.println(min+" "+ max+" "+ add) System.out.println System.out System System.out min+" "+ max+" "+ add " " max min+" "+ max+" "+ add min " " max " " add String[] args args public class Main{
	public static void main(String[] args)throws Exception{
		long add=0;
	
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line1 = br.readLine();
		String[] line2 = br.readLine().split(" ");
		StringBuilder sb = new StringBuilder();
		
		int n = Integer.parseInt(line1);
		int[] a = new int[n];
		int min = Integer.MAX_VALUE;
		int max = Integer.MIN_VALUE;
		
		for(int i=0; i<n; i++){
			a[i] = Integer.parseInt(line2[i]);
			if(a[i] < min){
				min = a[i];
			}	if(a[i] > max){
				max = a[i];
			}
			add += a[i];
		}
		System.out.println(min+" "+ max+" "+ add);		
	}
} public class Main{
	public static void main(String[] args)throws Exception{
		long add=0;
	
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line1 = br.readLine();
		String[] line2 = br.readLine().split(" ");
		StringBuilder sb = new StringBuilder();
		
		int n = Integer.parseInt(line1);
		int[] a = new int[n];
		int min = Integer.MAX_VALUE;
		int max = Integer.MIN_VALUE;
		
		for(int i=0; i<n; i++){
			a[i] = Integer.parseInt(line2[i]);
			if(a[i] < min){
				min = a[i];
			}	if(a[i] > max){
				max = a[i];
			}
			add += a[i];
		}
		System.out.println(min+" "+ max+" "+ add);		
	}
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main{
	public static void main(String[] args)throws Exception{
		long add=0;
	
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line1 = br.readLine();
		String[] line2 = br.readLine().split(" ");
		StringBuilder sb = new StringBuilder();
		
		int n = Integer.parseInt(line1);
		int[] a = new int[n];
		int min = Integer.MAX_VALUE;
		int max = Integer.MIN_VALUE;
		
		for(int i=0; i<n; i++){
			a[i] = Integer.parseInt(line2[i]);
			if(a[i] < min){
				min = a[i];
			}	if(a[i] > max){
				max = a[i];
			}
			add += a[i];
		}
		System.out.println(min+" "+ max+" "+ add);		
	}
}