import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.text.DecimalFormat;
import java.util.ArrayList;


class Main {
	public static void main(String[] args) throws IOException {
		DecimalFormat df1 = new DecimalFormat("0.000000");
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String s = new String(in.readLine());
		s = new String(in.readLine());
		String[] ss = s.split(" ");
		ArrayList<Integer> is = new ArrayList<Integer>();
		for(int i = 0; i< ss.length;i++){
			is.add(Integer.parseInt(ss[i]));
		}
		int max = -1000000;
		for(Integer i:is){
			if(i > max){
				max = i;
			}
			
		}
		int min = 1000000;
		for(Integer i:is){
			if(i < min){
				min = i;
			}
		}
		long sum = 0;
		for(Integer i:is){
			sum = sum + i;
			
		}
		System.out.println(min+" "+max+" "+sum);
		
	}

} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.text.DecimalFormat; DecimalFormat java.text import java.util.ArrayList; ArrayList java.util class Main {
	public static void main(String[] args) throws IOException {
		DecimalFormat df1 = new DecimalFormat("0.000000");
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String s = new String(in.readLine());
		s = new String(in.readLine());
		String[] ss = s.split(" ");
		ArrayList<Integer> is = new ArrayList<Integer>();
		for(int i = 0; i< ss.length;i++){
			is.add(Integer.parseInt(ss[i]));
		}
		int max = -1000000;
		for(Integer i:is){
			if(i > max){
				max = i;
			}
			
		}
		int min = 1000000;
		for(Integer i:is){
			if(i < min){
				min = i;
			}
		}
		long sum = 0;
		for(Integer i:is){
			sum = sum + i;
			
		}
		System.out.println(min+" "+max+" "+sum);
		
	}

} Main public static void main(String[] args) throws IOException {
		DecimalFormat df1 = new DecimalFormat("0.000000");
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String s = new String(in.readLine());
		s = new String(in.readLine());
		String[] ss = s.split(" ");
		ArrayList<Integer> is = new ArrayList<Integer>();
		for(int i = 0; i< ss.length;i++){
			is.add(Integer.parseInt(ss[i]));
		}
		int max = -1000000;
		for(Integer i:is){
			if(i > max){
				max = i;
			}
			
		}
		int min = 1000000;
		for(Integer i:is){
			if(i < min){
				min = i;
			}
		}
		long sum = 0;
		for(Integer i:is){
			sum = sum + i;
			
		}
		System.out.println(min+" "+max+" "+sum);
		
	} main {
		DecimalFormat df1 = new DecimalFormat("0.000000");
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String s = new String(in.readLine());
		s = new String(in.readLine());
		String[] ss = s.split(" ");
		ArrayList<Integer> is = new ArrayList<Integer>();
		for(int i = 0; i< ss.length;i++){
			is.add(Integer.parseInt(ss[i]));
		}
		int max = -1000000;
		for(Integer i:is){
			if(i > max){
				max = i;
			}
			
		}
		int min = 1000000;
		for(Integer i:is){
			if(i < min){
				min = i;
			}
		}
		long sum = 0;
		for(Integer i:is){
			sum = sum + i;
			
		}
		System.out.println(min+" "+max+" "+sum);
		
	} DecimalFormat df1 = new DecimalFormat("0.000000"); df1 new DecimalFormat("0.000000") BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); in new BufferedReader(new InputStreamReader(System.in)) String s = new String(in.readLine()); s new String(in.readLine()) s = new String(in.readLine()) s new String(in.readLine()) String[] ss = s.split(" "); ss s.split(" ") s.split s " " ArrayList<Integer> is = new ArrayList<Integer>(); is new ArrayList<Integer>() for(int i = 0; i< ss.length;i++){
			is.add(Integer.parseInt(ss[i]));
		} int i = 0; int i = 0; i 0 i< ss.length i ss.length ss ss.length i++ i++ i {
			is.add(Integer.parseInt(ss[i]));
		} {
			is.add(Integer.parseInt(ss[i]));
		} is.add(Integer.parseInt(ss[i])) is.add is Integer.parseInt(ss[i]) Integer.parseInt Integer ss[i] ss i int max = -1000000; max -1000000 1000000 for(Integer i:is){
			if(i > max){
				max = i;
			}
			
		} Integer i is {
			if(i > max){
				max = i;
			}
			
		} {
			if(i > max){
				max = i;
			}
			
		} if(i > max){
				max = i;
			} i > max i max {
				max = i;
			} max = i max i int min = 1000000; min 1000000 for(Integer i:is){
			if(i < min){
				min = i;
			}
		} Integer i is {
			if(i < min){
				min = i;
			}
		} {
			if(i < min){
				min = i;
			}
		} if(i < min){
				min = i;
			} i < min i min {
				min = i;
			} min = i min i long sum = 0; sum 0 for(Integer i:is){
			sum = sum + i;
			
		} Integer i is {
			sum = sum + i;
			
		} {
			sum = sum + i;
			
		} sum = sum + i sum sum + i sum 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
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.text.DecimalFormat;
import java.util.ArrayList;


class Main {
	public static void main(String[] args) throws IOException {
		DecimalFormat df1 = new DecimalFormat("0.000000");
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String s = new String(in.readLine());
		s = new String(in.readLine());
		String[] ss = s.split(" ");
		ArrayList<Integer> is = new ArrayList<Integer>();
		for(int i = 0; i< ss.length;i++){
			is.add(Integer.parseInt(ss[i]));
		}
		int max = -1000000;
		for(Integer i:is){
			if(i > max){
				max = i;
			}
			
		}
		int min = 1000000;
		for(Integer i:is){
			if(i < min){
				min = i;
			}
		}
		long sum = 0;
		for(Integer i:is){
			sum = sum + i;
			
		}
		System.out.println(min+" "+max+" "+sum);
		
	}

}