import java.io.*;
public class Main{
    public static void main(String[] args) throws Exception{
        BufferedReader buf=new BufferedReader(new InputStreamReader(System.in));
        int x=Integer.parseInt(buf.readLine());
        String num[]=buf.readLine().split(" ");
        int max=-99999999,min=99999999;
        long sum=0;
        for(int i=0;i<num.length;i++){
            int tmp=Integer.parseInt(num[i]);
            if(tmp>max){
                max=tmp;
            }if(tmp<min){
                min=tmp;
            }
            sum +=tmp;
                
        }
        System.out.println(min+" "+max+" "+sum);
    }
} import java.io.*; io.* java public class Main{
    public static void main(String[] args) throws Exception{
        BufferedReader buf=new BufferedReader(new InputStreamReader(System.in));
        int x=Integer.parseInt(buf.readLine());
        String num[]=buf.readLine().split(" ");
        int max=-99999999,min=99999999;
        long sum=0;
        for(int i=0;i<num.length;i++){
            int tmp=Integer.parseInt(num[i]);
            if(tmp>max){
                max=tmp;
            }if(tmp<min){
                min=tmp;
            }
            sum +=tmp;
                
        }
        System.out.println(min+" "+max+" "+sum);
    }
} Main public static void main(String[] args) throws Exception{
        BufferedReader buf=new BufferedReader(new InputStreamReader(System.in));
        int x=Integer.parseInt(buf.readLine());
        String num[]=buf.readLine().split(" ");
        int max=-99999999,min=99999999;
        long sum=0;
        for(int i=0;i<num.length;i++){
            int tmp=Integer.parseInt(num[i]);
            if(tmp>max){
                max=tmp;
            }if(tmp<min){
                min=tmp;
            }
            sum +=tmp;
                
        }
        System.out.println(min+" "+max+" "+sum);
    } main {
        BufferedReader buf=new BufferedReader(new InputStreamReader(System.in));
        int x=Integer.parseInt(buf.readLine());
        String num[]=buf.readLine().split(" ");
        int max=-99999999,min=99999999;
        long sum=0;
        for(int i=0;i<num.length;i++){
            int tmp=Integer.parseInt(num[i]);
            if(tmp>max){
                max=tmp;
            }if(tmp<min){
                min=tmp;
            }
            sum +=tmp;
                
        }
        System.out.println(min+" "+max+" "+sum);
    } BufferedReader buf=new BufferedReader(new InputStreamReader(System.in)); buf new BufferedReader(new InputStreamReader(System.in)) int x=Integer.parseInt(buf.readLine()); x Integer.parseInt(buf.readLine()) Integer.parseInt Integer buf.readLine() buf.readLine buf String num[]=buf.readLine().split(" "); num buf.readLine().split(" ") buf.readLine().split buf.readLine() buf.readLine buf " " int max=-99999999 max -99999999 99999999 min=99999999; min 99999999 long sum=0; sum 0 for(int i=0;i<num.length;i++){
            int tmp=Integer.parseInt(num[i]);
            if(tmp>max){
                max=tmp;
            }if(tmp<min){
                min=tmp;
            }
            sum +=tmp;
                
        } int i=0; int i=0; i 0 i<num.length i num.length num num.length i++ i++ i {
            int tmp=Integer.parseInt(num[i]);
            if(tmp>max){
                max=tmp;
            }if(tmp<min){
                min=tmp;
            }
            sum +=tmp;
                
        } {
            int tmp=Integer.parseInt(num[i]);
            if(tmp>max){
                max=tmp;
            }if(tmp<min){
                min=tmp;
            }
            sum +=tmp;
                
        } int tmp=Integer.parseInt(num[i]); tmp Integer.parseInt(num[i]) Integer.parseInt Integer num[i] num i if(tmp>max){
                max=tmp;
            } tmp>max tmp max {
                max=tmp;
            } max=tmp max tmp if(tmp<min){
                min=tmp;
            } tmp<min tmp min {
                min=tmp;
            } min=tmp min tmp sum +=tmp sum tmp 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) throws Exception{
        BufferedReader buf=new BufferedReader(new InputStreamReader(System.in));
        int x=Integer.parseInt(buf.readLine());
        String num[]=buf.readLine().split(" ");
        int max=-99999999,min=99999999;
        long sum=0;
        for(int i=0;i<num.length;i++){
            int tmp=Integer.parseInt(num[i]);
            if(tmp>max){
                max=tmp;
            }if(tmp<min){
                min=tmp;
            }
            sum +=tmp;
                
        }
        System.out.println(min+" "+max+" "+sum);
    }
} public class Main{
    public static void main(String[] args) throws Exception{
        BufferedReader buf=new BufferedReader(new InputStreamReader(System.in));
        int x=Integer.parseInt(buf.readLine());
        String num[]=buf.readLine().split(" ");
        int max=-99999999,min=99999999;
        long sum=0;
        for(int i=0;i<num.length;i++){
            int tmp=Integer.parseInt(num[i]);
            if(tmp>max){
                max=tmp;
            }if(tmp<min){
                min=tmp;
            }
            sum +=tmp;
                
        }
        System.out.println(min+" "+max+" "+sum);
    }
} Main
import java.io.*;
public class Main{
    public static void main(String[] args) throws Exception{
        BufferedReader buf=new BufferedReader(new InputStreamReader(System.in));
        int x=Integer.parseInt(buf.readLine());
        String num[]=buf.readLine().split(" ");
        int max=-99999999,min=99999999;
        long sum=0;
        for(int i=0;i<num.length;i++){
            int tmp=Integer.parseInt(num[i]);
            if(tmp>max){
                max=tmp;
            }if(tmp<min){
                min=tmp;
            }
            sum +=tmp;
                
        }
        System.out.println(min+" "+max+" "+sum);
    }
}