import java.util.Scanner;
/**
 * @author kawakami
 *
 */
class Main {
    /**
     * @param args
     */
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        Scanner as = new Scanner(System.in);
         
        int n=as.nextInt();
        long tr,sum;
        int j = 0,k = 0;
        long jug[] = new long[n];
         
         
         
        jug[0]=as.nextInt();
        sum=jug[0];
         
         
        for(int i=1;i<n;i++){       //????¨????????¨????
            jug[i]=as.nextInt();
            sum=sum+jug[i];
        }
        while(j!=1){
            j=1;
            for(k = 0;k<n-1;k++){//?????????????´?????°????????????????????????????
                 
                if(jug[k]>jug[k+1]){
                    tr=jug[k];
                    jug[k]=jug[k+1];
                    jug[k+1]=tr;
                    j=0;
                }
            }
             
             
        }
        System.out.println(jug[0]+" "+jug[k]+" "+sum);
 
    }
 
} import java.util.Scanner; Scanner java.util class Main {
    /**
     * @param args
     */
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        Scanner as = new Scanner(System.in);
         
        int n=as.nextInt();
        long tr,sum;
        int j = 0,k = 0;
        long jug[] = new long[n];
         
         
         
        jug[0]=as.nextInt();
        sum=jug[0];
         
         
        for(int i=1;i<n;i++){       //????¨????????¨????
            jug[i]=as.nextInt();
            sum=sum+jug[i];
        }
        while(j!=1){
            j=1;
            for(k = 0;k<n-1;k++){//?????????????´?????°????????????????????????????
                 
                if(jug[k]>jug[k+1]){
                    tr=jug[k];
                    jug[k]=jug[k+1];
                    jug[k+1]=tr;
                    j=0;
                }
            }
             
             
        }
        System.out.println(jug[0]+" "+jug[k]+" "+sum);
 
    }
 
} Main /**
     * @param args
     */
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        Scanner as = new Scanner(System.in);
         
        int n=as.nextInt();
        long tr,sum;
        int j = 0,k = 0;
        long jug[] = new long[n];
         
         
         
        jug[0]=as.nextInt();
        sum=jug[0];
         
         
        for(int i=1;i<n;i++){       //????¨????????¨????
            jug[i]=as.nextInt();
            sum=sum+jug[i];
        }
        while(j!=1){
            j=1;
            for(k = 0;k<n-1;k++){//?????????????´?????°????????????????????????????
                 
                if(jug[k]>jug[k+1]){
                    tr=jug[k];
                    jug[k]=jug[k+1];
                    jug[k+1]=tr;
                    j=0;
                }
            }
             
             
        }
        System.out.println(jug[0]+" "+jug[k]+" "+sum);
 
    } main {
        // TODO Auto-generated method stub
        Scanner as = new Scanner(System.in);
         
        int n=as.nextInt();
        long tr,sum;
        int j = 0,k = 0;
        long jug[] = new long[n];
         
         
         
        jug[0]=as.nextInt();
        sum=jug[0];
         
         
        for(int i=1;i<n;i++){       //????¨????????¨????
            jug[i]=as.nextInt();
            sum=sum+jug[i];
        }
        while(j!=1){
            j=1;
            for(k = 0;k<n-1;k++){//?????????????´?????°????????????????????????????
                 
                if(jug[k]>jug[k+1]){
                    tr=jug[k];
                    jug[k]=jug[k+1];
                    jug[k+1]=tr;
                    j=0;
                }
            }
             
             
        }
        System.out.println(jug[0]+" "+jug[k]+" "+sum);
 
    } Scanner as = new Scanner(System.in); as new Scanner(System.in) int n=as.nextInt(); n as.nextInt() as.nextInt as long tr tr sum; sum int j = 0 j 0 k = 0; k 0 long jug[] = new long[n]; jug new long[n] n jug[0]=as.nextInt() jug[0] jug 0 as.nextInt() as.nextInt as sum=jug[0] sum jug[0] jug 0 for(int i=1;i<n;i++){       //????¨????????¨????
            jug[i]=as.nextInt();
            sum=sum+jug[i];
        } int i=1; int i=1; i 1 i<n i n i++ i++ i {       //????¨????????¨????
            jug[i]=as.nextInt();
            sum=sum+jug[i];
        } {       //????¨????????¨????
            jug[i]=as.nextInt();
            sum=sum+jug[i];
        } jug[i]=as.nextInt() jug[i] jug i as.nextInt() as.nextInt as sum=sum+jug[i] sum sum+jug[i] sum jug[i] jug i while(j!=1){
            j=1;
            for(k = 0;k<n-1;k++){//?????????????´?????°????????????????????????????
                 
                if(jug[k]>jug[k+1]){
                    tr=jug[k];
                    jug[k]=jug[k+1];
                    jug[k+1]=tr;
                    j=0;
                }
            }
             
             
        } j!=1 j 1 {
            j=1;
            for(k = 0;k<n-1;k++){//?????????????´?????°????????????????????????????
                 
                if(jug[k]>jug[k+1]){
                    tr=jug[k];
                    jug[k]=jug[k+1];
                    jug[k+1]=tr;
                    j=0;
                }
            }
             
             
        } j=1 j 1 for(k = 0;k<n-1;k++){//?????????????´?????°????????????????????????????
                 
                if(jug[k]>jug[k+1]){
                    tr=jug[k];
                    jug[k]=jug[k+1];
                    jug[k+1]=tr;
                    j=0;
                }
            } k = 0; k = 0 k 0 k<n-1 k n-1 n 1 k++ k++ k {//?????????????´?????°????????????????????????????
                 
                if(jug[k]>jug[k+1]){
                    tr=jug[k];
                    jug[k]=jug[k+1];
                    jug[k+1]=tr;
                    j=0;
                }
            } {//?????????????´?????°????????????????????????????
                 
                if(jug[k]>jug[k+1]){
                    tr=jug[k];
                    jug[k]=jug[k+1];
                    jug[k+1]=tr;
                    j=0;
                }
            } if(jug[k]>jug[k+1]){
                    tr=jug[k];
                    jug[k]=jug[k+1];
                    jug[k+1]=tr;
                    j=0;
                } jug[k]>jug[k+1] jug[k] jug k jug[k+1] jug k+1 k 1 {
                    tr=jug[k];
                    jug[k]=jug[k+1];
                    jug[k+1]=tr;
                    j=0;
                } tr=jug[k] tr jug[k] jug k jug[k]=jug[k+1] jug[k] jug k jug[k+1] jug k+1 k 1 jug[k+1]=tr jug[k+1] jug k+1 k 1 tr j=0 j 0 System.out.println(jug[0]+" "+jug[k]+" "+sum) System.out.println System.out System System.out jug[0]+" "+jug[k]+" "+sum " " jug[k] jug[0]+" "+jug[k]+" "+sum jug[0] jug 0 " " jug[k] jug k " " sum String[] args args
import java.util.Scanner;
/**
 * @author kawakami
 *
 */
class Main {
    /**
     * @param args
     */
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        Scanner as = new Scanner(System.in);
         
        int n=as.nextInt();
        long tr,sum;
        int j = 0,k = 0;
        long jug[] = new long[n];
         
         
         
        jug[0]=as.nextInt();
        sum=jug[0];
         
         
        for(int i=1;i<n;i++){       //????¨????????¨????
            jug[i]=as.nextInt();
            sum=sum+jug[i];
        }
        while(j!=1){
            j=1;
            for(k = 0;k<n-1;k++){//?????????????´?????°????????????????????????????
                 
                if(jug[k]>jug[k+1]){
                    tr=jug[k];
                    jug[k]=jug[k+1];
                    jug[k+1]=tr;
                    j=0;
                }
            }
             
             
        }
        System.out.println(jug[0]+" "+jug[k]+" "+sum);
 
    }
 
}