import java.io.*;
import java.util.*;

class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		int N=Integer.parseInt(br.readLine());
		String s=br.readLine();
		int num;
		if(N>1){
	        num=Integer.parseInt(s.substring(0, s.indexOf(" ")));
		}else{
			num=Integer.parseInt(s.substring(0));
		}
        int min=num,max=num;
        long sum=num;
		if(N>1){
	        List<String> a=Arrays.asList(s.substring(s.indexOf(" ")+1).split(" "));
	        for(String n:a){
	        	num=Integer.parseInt(n);
	            if(num<min) min=num;
	            if(num>max) max=num;
	            sum+=num;
	        }
		}
        System.out.println(min+" "+max+" "+sum);
	}
} import java.io.*; io.* java import java.util.*; util.* java class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		int N=Integer.parseInt(br.readLine());
		String s=br.readLine();
		int num;
		if(N>1){
	        num=Integer.parseInt(s.substring(0, s.indexOf(" ")));
		}else{
			num=Integer.parseInt(s.substring(0));
		}
        int min=num,max=num;
        long sum=num;
		if(N>1){
	        List<String> a=Arrays.asList(s.substring(s.indexOf(" ")+1).split(" "));
	        for(String n:a){
	        	num=Integer.parseInt(n);
	            if(num<min) min=num;
	            if(num>max) max=num;
	            sum+=num;
	        }
		}
        System.out.println(min+" "+max+" "+sum);
	}
} Main public static void main(String[] args) throws Exception {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		int N=Integer.parseInt(br.readLine());
		String s=br.readLine();
		int num;
		if(N>1){
	        num=Integer.parseInt(s.substring(0, s.indexOf(" ")));
		}else{
			num=Integer.parseInt(s.substring(0));
		}
        int min=num,max=num;
        long sum=num;
		if(N>1){
	        List<String> a=Arrays.asList(s.substring(s.indexOf(" ")+1).split(" "));
	        for(String n:a){
	        	num=Integer.parseInt(n);
	            if(num<min) min=num;
	            if(num>max) max=num;
	            sum+=num;
	        }
		}
        System.out.println(min+" "+max+" "+sum);
	} main {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		int N=Integer.parseInt(br.readLine());
		String s=br.readLine();
		int num;
		if(N>1){
	        num=Integer.parseInt(s.substring(0, s.indexOf(" ")));
		}else{
			num=Integer.parseInt(s.substring(0));
		}
        int min=num,max=num;
        long sum=num;
		if(N>1){
	        List<String> a=Arrays.asList(s.substring(s.indexOf(" ")+1).split(" "));
	        for(String n:a){
	        	num=Integer.parseInt(n);
	            if(num<min) min=num;
	            if(num>max) max=num;
	            sum+=num;
	        }
		}
        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 s=br.readLine(); s br.readLine() br.readLine br int num; num if(N>1){
	        num=Integer.parseInt(s.substring(0, s.indexOf(" ")));
		}else{
			num=Integer.parseInt(s.substring(0));
		} N>1 N 1 {
	        num=Integer.parseInt(s.substring(0, s.indexOf(" ")));
		} num=Integer.parseInt(s.substring(0, s.indexOf(" "))) num Integer.parseInt(s.substring(0, s.indexOf(" "))) Integer.parseInt Integer s.substring(0, s.indexOf(" ")) s.substring s 0 s.indexOf(" ") s.indexOf s " " {
			num=Integer.parseInt(s.substring(0));
		} num=Integer.parseInt(s.substring(0)) num Integer.parseInt(s.substring(0)) Integer.parseInt Integer s.substring(0) s.substring s 0 int min=num min num max=num; max num long sum=num; sum num if(N>1){
	        List<String> a=Arrays.asList(s.substring(s.indexOf(" ")+1).split(" "));
	        for(String n:a){
	        	num=Integer.parseInt(n);
	            if(num<min) min=num;
	            if(num>max) max=num;
	            sum+=num;
	        }
		} N>1 N 1 {
	        List<String> a=Arrays.asList(s.substring(s.indexOf(" ")+1).split(" "));
	        for(String n:a){
	        	num=Integer.parseInt(n);
	            if(num<min) min=num;
	            if(num>max) max=num;
	            sum+=num;
	        }
		} List<String> a=Arrays.asList(s.substring(s.indexOf(" ")+1).split(" ")); a Arrays.asList(s.substring(s.indexOf(" ")+1).split(" ")) Arrays.asList Arrays s.substring(s.indexOf(" ")+1).split(" ") s.substring(s.indexOf(" ")+1).split s.substring(s.indexOf(" ")+1) s.substring s s.indexOf(" ")+1 s.indexOf(" ") s.indexOf s " " 1 " " for(String n:a){
	        	num=Integer.parseInt(n);
	            if(num<min) min=num;
	            if(num>max) max=num;
	            sum+=num;
	        } String n a {
	        	num=Integer.parseInt(n);
	            if(num<min) min=num;
	            if(num>max) max=num;
	            sum+=num;
	        } {
	        	num=Integer.parseInt(n);
	            if(num<min) min=num;
	            if(num>max) max=num;
	            sum+=num;
	        } num=Integer.parseInt(n) num Integer.parseInt(n) Integer.parseInt Integer n if(num<min) min=num; num<min num min min=num min num if(num>max) max=num; num>max num max max=num max num sum+=num sum num 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.*;
import java.util.*;

class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		int N=Integer.parseInt(br.readLine());
		String s=br.readLine();
		int num;
		if(N>1){
	        num=Integer.parseInt(s.substring(0, s.indexOf(" ")));
		}else{
			num=Integer.parseInt(s.substring(0));
		}
        int min=num,max=num;
        long sum=num;
		if(N>1){
	        List<String> a=Arrays.asList(s.substring(s.indexOf(" ")+1).split(" "));
	        for(String n:a){
	        	num=Integer.parseInt(n);
	            if(num<min) min=num;
	            if(num>max) max=num;
	            sum+=num;
	        }
		}
        System.out.println(min+" "+max+" "+sum);
	}
}