import java.io.*;

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

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