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

class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		br.readLine();
		List<String> a=Arrays.asList(br.readLine().split(" "));
		int n1=Integer.parseInt(a.get(0));
        int min=n1,max=n1;
        long sum=n1;
        for(Iterator<String> i=a.iterator();i.hasNext();){
			String s=i.next();
        	int n2=Integer.parseInt(s);
            if(n2<min) min=n2;
            if(n2>max) max=n2;
            sum+=n2;
		}
        System.out.println(min+" "+max+" "+(sum-n1));
	}
} 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));
		br.readLine();
		List<String> a=Arrays.asList(br.readLine().split(" "));
		int n1=Integer.parseInt(a.get(0));
        int min=n1,max=n1;
        long sum=n1;
        for(Iterator<String> i=a.iterator();i.hasNext();){
			String s=i.next();
        	int n2=Integer.parseInt(s);
            if(n2<min) min=n2;
            if(n2>max) max=n2;
            sum+=n2;
		}
        System.out.println(min+" "+max+" "+(sum-n1));
	}
} Main public static void main(String[] args) throws Exception {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		br.readLine();
		List<String> a=Arrays.asList(br.readLine().split(" "));
		int n1=Integer.parseInt(a.get(0));
        int min=n1,max=n1;
        long sum=n1;
        for(Iterator<String> i=a.iterator();i.hasNext();){
			String s=i.next();
        	int n2=Integer.parseInt(s);
            if(n2<min) min=n2;
            if(n2>max) max=n2;
            sum+=n2;
		}
        System.out.println(min+" "+max+" "+(sum-n1));
	} main {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		br.readLine();
		List<String> a=Arrays.asList(br.readLine().split(" "));
		int n1=Integer.parseInt(a.get(0));
        int min=n1,max=n1;
        long sum=n1;
        for(Iterator<String> i=a.iterator();i.hasNext();){
			String s=i.next();
        	int n2=Integer.parseInt(s);
            if(n2<min) min=n2;
            if(n2>max) max=n2;
            sum+=n2;
		}
        System.out.println(min+" "+max+" "+(sum-n1));
	} BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) br.readLine() br.readLine br List<String> a=Arrays.asList(br.readLine().split(" ")); a Arrays.asList(br.readLine().split(" ")) Arrays.asList Arrays br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int n1=Integer.parseInt(a.get(0)); n1 Integer.parseInt(a.get(0)) Integer.parseInt Integer a.get(0) a.get a 0 int min=n1 min n1 max=n1; max n1 long sum=n1; sum n1 for(Iterator<String> i=a.iterator();i.hasNext();){
			String s=i.next();
        	int n2=Integer.parseInt(s);
            if(n2<min) min=n2;
            if(n2>max) max=n2;
            sum+=n2;
		} Iterator<String> i=a.iterator(); Iterator<String> i=a.iterator(); i a.iterator() a.iterator a i.hasNext() i.hasNext i {
			String s=i.next();
        	int n2=Integer.parseInt(s);
            if(n2<min) min=n2;
            if(n2>max) max=n2;
            sum+=n2;
		} {
			String s=i.next();
        	int n2=Integer.parseInt(s);
            if(n2<min) min=n2;
            if(n2>max) max=n2;
            sum+=n2;
		} String s=i.next(); s i.next() i.next i int n2=Integer.parseInt(s); n2 Integer.parseInt(s) Integer.parseInt Integer s if(n2<min) min=n2; n2<min n2 min min=n2 min n2 if(n2>max) max=n2; n2>max n2 max max=n2 max n2 sum+=n2 sum n2 System.out.println(min+" "+max+" "+(sum-n1)) System.out.println System.out System System.out min+" "+max+" "+(sum-n1) " " max min+" "+max+" "+(sum-n1) min " " max " " (sum-n1) sum n1 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));
		br.readLine();
		List<String> a=Arrays.asList(br.readLine().split(" "));
		int n1=Integer.parseInt(a.get(0));
        int min=n1,max=n1;
        long sum=n1;
        for(Iterator<String> i=a.iterator();i.hasNext();){
			String s=i.next();
        	int n2=Integer.parseInt(s);
            if(n2<min) min=n2;
            if(n2>max) max=n2;
            sum+=n2;
		}
        System.out.println(min+" "+max+" "+(sum-n1));
	}
}