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