import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner o = new Scanner(System.in);
		int n = o.nextInt();
		int a = o.nextInt();
		int max = a;
		int min = a;
		long sum = 0;
		
		for(int i = 0;i < n;i++){
			//System.out.println(a);
			if(max < a){
				max = a;
			}	
			if(min > a){
				min = a;
			}
			sum = sum + a;
			if((n-1) != i)
				a = o.nextInt();
			else
				break;
		}
		System.out.println(min+" "+max+" "+sum);
	}

} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args){
		Scanner o = new Scanner(System.in);
		int n = o.nextInt();
		int a = o.nextInt();
		int max = a;
		int min = a;
		long sum = 0;
		
		for(int i = 0;i < n;i++){
			//System.out.println(a);
			if(max < a){
				max = a;
			}	
			if(min > a){
				min = a;
			}
			sum = sum + a;
			if((n-1) != i)
				a = o.nextInt();
			else
				break;
		}
		System.out.println(min+" "+max+" "+sum);
	}

} Main public static void main(String[] args){
		Scanner o = new Scanner(System.in);
		int n = o.nextInt();
		int a = o.nextInt();
		int max = a;
		int min = a;
		long sum = 0;
		
		for(int i = 0;i < n;i++){
			//System.out.println(a);
			if(max < a){
				max = a;
			}	
			if(min > a){
				min = a;
			}
			sum = sum + a;
			if((n-1) != i)
				a = o.nextInt();
			else
				break;
		}
		System.out.println(min+" "+max+" "+sum);
	} main {
		Scanner o = new Scanner(System.in);
		int n = o.nextInt();
		int a = o.nextInt();
		int max = a;
		int min = a;
		long sum = 0;
		
		for(int i = 0;i < n;i++){
			//System.out.println(a);
			if(max < a){
				max = a;
			}	
			if(min > a){
				min = a;
			}
			sum = sum + a;
			if((n-1) != i)
				a = o.nextInt();
			else
				break;
		}
		System.out.println(min+" "+max+" "+sum);
	} Scanner o = new Scanner(System.in); o new Scanner(System.in) int n = o.nextInt(); n o.nextInt() o.nextInt o int a = o.nextInt(); a o.nextInt() o.nextInt o int max = a; max a int min = a; min a long sum = 0; sum 0 for(int i = 0;i < n;i++){
			//System.out.println(a);
			if(max < a){
				max = a;
			}	
			if(min > a){
				min = a;
			}
			sum = sum + a;
			if((n-1) != i)
				a = o.nextInt();
			else
				break;
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			//System.out.println(a);
			if(max < a){
				max = a;
			}	
			if(min > a){
				min = a;
			}
			sum = sum + a;
			if((n-1) != i)
				a = o.nextInt();
			else
				break;
		} {
			//System.out.println(a);
			if(max < a){
				max = a;
			}	
			if(min > a){
				min = a;
			}
			sum = sum + a;
			if((n-1) != i)
				a = o.nextInt();
			else
				break;
		} if(max < a){
				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 min a sum = sum + a sum sum + a sum a if((n-1) != i)
				a = o.nextInt();
			else
				break; (n-1) != i (n-1) n 1 i a = o.nextInt() a o.nextInt() o.nextInt o break; 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 o = new Scanner(System.in);
		int n = o.nextInt();
		int a = o.nextInt();
		int max = a;
		int min = a;
		long sum = 0;
		
		for(int i = 0;i < n;i++){
			//System.out.println(a);
			if(max < a){
				max = a;
			}	
			if(min > a){
				min = a;
			}
			sum = sum + a;
			if((n-1) != i)
				a = o.nextInt();
			else
				break;
		}
		System.out.println(min+" "+max+" "+sum);
	}

} public class Main {
	public static void main(String[] args){
		Scanner o = new Scanner(System.in);
		int n = o.nextInt();
		int a = o.nextInt();
		int max = a;
		int min = a;
		long sum = 0;
		
		for(int i = 0;i < n;i++){
			//System.out.println(a);
			if(max < a){
				max = a;
			}	
			if(min > a){
				min = a;
			}
			sum = sum + a;
			if((n-1) != i)
				a = o.nextInt();
			else
				break;
		}
		System.out.println(min+" "+max+" "+sum);
	}

} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner o = new Scanner(System.in);
		int n = o.nextInt();
		int a = o.nextInt();
		int max = a;
		int min = a;
		long sum = 0;
		
		for(int i = 0;i < n;i++){
			//System.out.println(a);
			if(max < a){
				max = a;
			}	
			if(min > a){
				min = a;
			}
			sum = sum + a;
			if((n-1) != i)
				a = o.nextInt();
			else
				break;
		}
		System.out.println(min+" "+max+" "+sum);
	}

}