import java.io.*;

class Main{
 public static void main(String[] args)throws IOException{
   BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
   String[] strAry; 
   long n,max,min,sum;
    n = Integer.parseInt(br.readLine()); 
   int i;   
   strAry = br.readLine().split(" ");
   min = Integer.parseInt(strAry[0]);  
   max = Integer.parseInt(strAry[0]);
   
     
   
   for(i=0,sum=0;i<n;i++){
     sum=sum + Integer.parseInt(strAry[i]);  
    if(min>Integer.parseInt(strAry[i])){ 
       min=Integer.parseInt(strAry[i]);
     }
     if(max<Integer.parseInt(strAry[i])){
       max=Integer.parseInt(strAry[i]);
      }
      
   }
       
      System.out.println(min+ " " + max +" "+sum);   

  }
} import java.io.*; io.* java class Main{
 public static void main(String[] args)throws IOException{
   BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
   String[] strAry; 
   long n,max,min,sum;
    n = Integer.parseInt(br.readLine()); 
   int i;   
   strAry = br.readLine().split(" ");
   min = Integer.parseInt(strAry[0]);  
   max = Integer.parseInt(strAry[0]);
   
     
   
   for(i=0,sum=0;i<n;i++){
     sum=sum + Integer.parseInt(strAry[i]);  
    if(min>Integer.parseInt(strAry[i])){ 
       min=Integer.parseInt(strAry[i]);
     }
     if(max<Integer.parseInt(strAry[i])){
       max=Integer.parseInt(strAry[i]);
      }
      
   }
       
      System.out.println(min+ " " + max +" "+sum);   

  }
} Main public static void main(String[] args)throws IOException{
   BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
   String[] strAry; 
   long n,max,min,sum;
    n = Integer.parseInt(br.readLine()); 
   int i;   
   strAry = br.readLine().split(" ");
   min = Integer.parseInt(strAry[0]);  
   max = Integer.parseInt(strAry[0]);
   
     
   
   for(i=0,sum=0;i<n;i++){
     sum=sum + Integer.parseInt(strAry[i]);  
    if(min>Integer.parseInt(strAry[i])){ 
       min=Integer.parseInt(strAry[i]);
     }
     if(max<Integer.parseInt(strAry[i])){
       max=Integer.parseInt(strAry[i]);
      }
      
   }
       
      System.out.println(min+ " " + max +" "+sum);   

  } main {
   BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
   String[] strAry; 
   long n,max,min,sum;
    n = Integer.parseInt(br.readLine()); 
   int i;   
   strAry = br.readLine().split(" ");
   min = Integer.parseInt(strAry[0]);  
   max = Integer.parseInt(strAry[0]);
   
     
   
   for(i=0,sum=0;i<n;i++){
     sum=sum + Integer.parseInt(strAry[i]);  
    if(min>Integer.parseInt(strAry[i])){ 
       min=Integer.parseInt(strAry[i]);
     }
     if(max<Integer.parseInt(strAry[i])){
       max=Integer.parseInt(strAry[i]);
      }
      
   }
       
      System.out.println(min+ " " + max +" "+sum);   

  } BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String[] strAry; strAry long n n max max min min sum; sum n = Integer.parseInt(br.readLine()) n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int i; i strAry = br.readLine().split(" ") strAry br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " min = Integer.parseInt(strAry[0]) min Integer.parseInt(strAry[0]) Integer.parseInt Integer strAry[0] strAry 0 max = Integer.parseInt(strAry[0]) max Integer.parseInt(strAry[0]) Integer.parseInt Integer strAry[0] strAry 0 for(i=0,sum=0;i<n;i++){
     sum=sum + Integer.parseInt(strAry[i]);  
    if(min>Integer.parseInt(strAry[i])){ 
       min=Integer.parseInt(strAry[i]);
     }
     if(max<Integer.parseInt(strAry[i])){
       max=Integer.parseInt(strAry[i]);
      }
      
   } i=0,sum=0; i=0 i 0 sum=0 sum 0 i<n i n i++ i++ i {
     sum=sum + Integer.parseInt(strAry[i]);  
    if(min>Integer.parseInt(strAry[i])){ 
       min=Integer.parseInt(strAry[i]);
     }
     if(max<Integer.parseInt(strAry[i])){
       max=Integer.parseInt(strAry[i]);
      }
      
   } {
     sum=sum + Integer.parseInt(strAry[i]);  
    if(min>Integer.parseInt(strAry[i])){ 
       min=Integer.parseInt(strAry[i]);
     }
     if(max<Integer.parseInt(strAry[i])){
       max=Integer.parseInt(strAry[i]);
      }
      
   } sum=sum + Integer.parseInt(strAry[i]) sum sum + Integer.parseInt(strAry[i]) sum Integer.parseInt(strAry[i]) Integer.parseInt Integer strAry[i] strAry i if(min>Integer.parseInt(strAry[i])){ 
       min=Integer.parseInt(strAry[i]);
     } min>Integer.parseInt(strAry[i]) min Integer.parseInt(strAry[i]) Integer.parseInt Integer strAry[i] strAry i { 
       min=Integer.parseInt(strAry[i]);
     } min=Integer.parseInt(strAry[i]) min Integer.parseInt(strAry[i]) Integer.parseInt Integer strAry[i] strAry i if(max<Integer.parseInt(strAry[i])){
       max=Integer.parseInt(strAry[i]);
      } max<Integer.parseInt(strAry[i]) max Integer.parseInt(strAry[i]) Integer.parseInt Integer strAry[i] strAry i {
       max=Integer.parseInt(strAry[i]);
      } max=Integer.parseInt(strAry[i]) max Integer.parseInt(strAry[i]) Integer.parseInt Integer strAry[i] strAry 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
import java.io.*;

class Main{
 public static void main(String[] args)throws IOException{
   BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
   String[] strAry; 
   long n,max,min,sum;
    n = Integer.parseInt(br.readLine()); 
   int i;   
   strAry = br.readLine().split(" ");
   min = Integer.parseInt(strAry[0]);  
   max = Integer.parseInt(strAry[0]);
   
     
   
   for(i=0,sum=0;i<n;i++){
     sum=sum + Integer.parseInt(strAry[i]);  
    if(min>Integer.parseInt(strAry[i])){ 
       min=Integer.parseInt(strAry[i]);
     }
     if(max<Integer.parseInt(strAry[i])){
       max=Integer.parseInt(strAry[i]);
      }
      
   }
       
      System.out.println(min+ " " + max +" "+sum);   

  }
}