//4-D
import java.util.Random;
import java.util.Scanner;

class Main{
  public static void main(String[] args) {
    
      Scanner sc = new Scanner(System.in);
      Random ran = new Random();
      
      int n = sc.nextInt();
      
      long sum = 0;
      
      int num [] = new int [n];
      
      	/*for(int i = 0 ; i < num.length ; i++ ){
	   	 num [i] = ran.nextInt(1000000);
	   	 //System.out.println(num[i]);
	   	 
	   	 sum = sum + num[i];
	   	 
	   }*/
      
	   for(int i = 0 ; i < num.length ; i++ ){
      		num[i] = sc.nextInt();
      		
      		sum = sum + num[i];

      	}
	   
  		int max = num[0];
  		int min = num[0];
	
		for(int i=0; i < num.length; i++ ){
			
			if (max < num[i]){	
				
				max = num[i];
				
				}
			
			if (min > num[i]){	
				
				min = num[i];
				
				}
		}
	
      System.out.println(min + " " + max + " " + sum);
	
  }
} import java.util.Random; Random java.util import java.util.Scanner; Scanner java.util class Main{
  public static void main(String[] args) {
    
      Scanner sc = new Scanner(System.in);
      Random ran = new Random();
      
      int n = sc.nextInt();
      
      long sum = 0;
      
      int num [] = new int [n];
      
      	/*for(int i = 0 ; i < num.length ; i++ ){
	   	 num [i] = ran.nextInt(1000000);
	   	 //System.out.println(num[i]);
	   	 
	   	 sum = sum + num[i];
	   	 
	   }*/
      
	   for(int i = 0 ; i < num.length ; i++ ){
      		num[i] = sc.nextInt();
      		
      		sum = sum + num[i];

      	}
	   
  		int max = num[0];
  		int min = num[0];
	
		for(int i=0; i < num.length; i++ ){
			
			if (max < num[i]){	
				
				max = num[i];
				
				}
			
			if (min > num[i]){	
				
				min = num[i];
				
				}
		}
	
      System.out.println(min + " " + max + " " + sum);
	
  }
} Main public static void main(String[] args) {
    
      Scanner sc = new Scanner(System.in);
      Random ran = new Random();
      
      int n = sc.nextInt();
      
      long sum = 0;
      
      int num [] = new int [n];
      
      	/*for(int i = 0 ; i < num.length ; i++ ){
	   	 num [i] = ran.nextInt(1000000);
	   	 //System.out.println(num[i]);
	   	 
	   	 sum = sum + num[i];
	   	 
	   }*/
      
	   for(int i = 0 ; i < num.length ; i++ ){
      		num[i] = sc.nextInt();
      		
      		sum = sum + num[i];

      	}
	   
  		int max = num[0];
  		int min = num[0];
	
		for(int i=0; i < num.length; i++ ){
			
			if (max < num[i]){	
				
				max = num[i];
				
				}
			
			if (min > num[i]){	
				
				min = num[i];
				
				}
		}
	
      System.out.println(min + " " + max + " " + sum);
	
  } main {
    
      Scanner sc = new Scanner(System.in);
      Random ran = new Random();
      
      int n = sc.nextInt();
      
      long sum = 0;
      
      int num [] = new int [n];
      
      	/*for(int i = 0 ; i < num.length ; i++ ){
	   	 num [i] = ran.nextInt(1000000);
	   	 //System.out.println(num[i]);
	   	 
	   	 sum = sum + num[i];
	   	 
	   }*/
      
	   for(int i = 0 ; i < num.length ; i++ ){
      		num[i] = sc.nextInt();
      		
      		sum = sum + num[i];

      	}
	   
  		int max = num[0];
  		int min = num[0];
	
		for(int i=0; i < num.length; i++ ){
			
			if (max < num[i]){	
				
				max = num[i];
				
				}
			
			if (min > num[i]){	
				
				min = num[i];
				
				}
		}
	
      System.out.println(min + " " + max + " " + sum);
	
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) Random ran = new Random(); ran new Random() int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc long sum = 0; sum 0 int num [] = new int [n]; num new int [n] n for(int i = 0 ; i < num.length ; i++ ){
      		num[i] = sc.nextInt();
      		
      		sum = sum + num[i];

      	} int i = 0 ; int i = 0 ; i 0 i < num.length i num.length num num.length i++ i++ i {
      		num[i] = sc.nextInt();
      		
      		sum = sum + num[i];

      	} {
      		num[i] = sc.nextInt();
      		
      		sum = sum + num[i];

      	} num[i] = sc.nextInt() num[i] num i sc.nextInt() sc.nextInt sc sum = sum + num[i] sum sum + num[i] sum num[i] num i int max = num[0]; max num[0] num 0 int min = num[0]; min num[0] num 0 for(int i=0; i < num.length; i++ ){
			
			if (max < num[i]){	
				
				max = num[i];
				
				}
			
			if (min > num[i]){	
				
				min = num[i];
				
				}
		} int i=0; int i=0; i 0 i < num.length i num.length num num.length i++ i++ i {
			
			if (max < num[i]){	
				
				max = num[i];
				
				}
			
			if (min > num[i]){	
				
				min = num[i];
				
				}
		} {
			
			if (max < num[i]){	
				
				max = num[i];
				
				}
			
			if (min > num[i]){	
				
				min = num[i];
				
				}
		} if (max < num[i]){	
				
				max = num[i];
				
				} max < num[i] max num[i] num i {	
				
				max = num[i];
				
				} max = num[i] max num[i] num i if (min > num[i]){	
				
				min = num[i];
				
				} min > num[i] min num[i] num i {	
				
				min = num[i];
				
				} min = num[i] min num[i] num 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
//4-D
import java.util.Random;
import java.util.Scanner;

class Main{
  public static void main(String[] args) {
    
      Scanner sc = new Scanner(System.in);
      Random ran = new Random();
      
      int n = sc.nextInt();
      
      long sum = 0;
      
      int num [] = new int [n];
      
      	/*for(int i = 0 ; i < num.length ; i++ ){
	   	 num [i] = ran.nextInt(1000000);
	   	 //System.out.println(num[i]);
	   	 
	   	 sum = sum + num[i];
	   	 
	   }*/
      
	   for(int i = 0 ; i < num.length ; i++ ){
      		num[i] = sc.nextInt();
      		
      		sum = sum + num[i];

      	}
	   
  		int max = num[0];
  		int min = num[0];
	
		for(int i=0; i < num.length; i++ ){
			
			if (max < num[i]){	
				
				max = num[i];
				
				}
			
			if (min > num[i]){	
				
				min = num[i];
				
				}
		}
	
      System.out.println(min + " " + max + " " + sum);
	
  }
}